diff options
Diffstat (limited to 'src/server/game/Maps/Map.cpp')
-rw-r--r-- | src/server/game/Maps/Map.cpp | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 54a9fdea264..90e072825de 100644 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -1934,25 +1934,14 @@ float Map::GetHeight(uint32 phasemask, float x, float y, float z, bool vmap/*=tr bool Map::IsInWater(float x, float y, float pZ, LiquidData* data) const { - // Check surface in x, y point for liquid - if (const_cast<Map*>(this)->GetGrid(x, y)) - { - LiquidData liquid_status; - LiquidData* liquid_ptr = data ? data : &liquid_status; - if (getLiquidStatus(x, y, pZ, MAP_ALL_LIQUIDS, liquid_ptr)) - return true; - } - return false; + LiquidData liquid_status; + LiquidData* liquid_ptr = data ? data : &liquid_status; + return getLiquidStatus(x, y, pZ, MAP_ALL_LIQUIDS, liquid_ptr) & (LIQUID_MAP_IN_WATER | LIQUID_MAP_UNDER_WATER); } bool Map::IsUnderWater(float x, float y, float z) const { - if (const_cast<Map*>(this)->GetGrid(x, y)) - { - if (getLiquidStatus(x, y, z, MAP_LIQUID_TYPE_WATER|MAP_LIQUID_TYPE_OCEAN)&LIQUID_MAP_UNDER_WATER) - return true; - } - return false; + return getLiquidStatus(x, y, z, MAP_LIQUID_TYPE_WATER|MAP_LIQUID_TYPE_OCEAN) & LIQUID_MAP_UNDER_WATER; } bool Map::CheckGridIntegrity(Creature* c, bool moved) const |