From f909c2f926d65c2639b79c57f76621fd2e44e168 Mon Sep 17 00:00:00 2001 From: John <63141077+AconiteX@users.noreply.github.com> Date: Wed, 15 Sep 2021 16:37:52 -0400 Subject: [PATCH] Add Lava Resistant Kit Functionality Support --- .../src/shared/controller/CreatureController.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/engine/server/library/serverGame/src/shared/controller/CreatureController.cpp b/engine/server/library/serverGame/src/shared/controller/CreatureController.cpp index 75ac1fae..a823971a 100755 --- a/engine/server/library/serverGame/src/shared/controller/CreatureController.cpp +++ b/engine/server/library/serverGame/src/shared/controller/CreatureController.cpp @@ -2037,8 +2037,15 @@ void CreatureController::calculateWaterState(bool& isSwimming, bool &isBurning, float terrainHeight; Footprint const * foot = collisionProperty->getFootprint(); + // a vehicle is immune to lava if either its template is identified as always having immunity + // see sku.0/sys.shared/compiled/game/datatables/terrain/creature_water_values.tab OR + // if it has the "vehicle.lava_resistance" ObjVar, which is added when the Lava Resistance Kit + // is used on the specific vehicle in question to create a resistance vehicle out of one that + // wouldn't otherwise normally be resistant (handled through scripts). + // SWG Source Change - 3.1 (for GU 17 item addition) - Aconite lavaResistance = ownerCreature->getLavaResistance(); - bool const isImmuneToLava = (lavaResistance == 100.0f); + bool const isImmuneToLava = (lavaResistance == 100.0f) || + ownerCreature->getObjVars().hasItem("vehicle.lava_resistance"); TerrainGeneratorWaterType waterType = terrainObject->getWaterType(position); if (!foot || !foot->getTerrainHeight(terrainHeight)) @@ -2183,4 +2190,4 @@ CreatureController const * CreatureController::asCreatureController(Controller c return (controller != nullptr) ? controller->asCreatureController() : nullptr; } -// ====================================================================== \ No newline at end of file +// ======================================================================