diff options
| author | Shauren <shauren.trinity@gmail.com> | 2013-06-07 16:00:44 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2013-06-07 16:00:44 +0200 |
| commit | e21b94c25c90299517732fa4f2522adfc6e0cc38 (patch) | |
| tree | 8ee12e59c5ab04af282eeffbfe8d71a81e3c3955 /src/server/game/Maps/Map.cpp | |
| parent | 1adf4624bb3eea00d799370bce4c2c21111db8ad (diff) | |
Core/Maps: Fixed Map::IsInWater returning true at any height above water
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 d59f475f300..493ddc662b4 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 |
