Core/Maps: use correct map pointer to get grids in GetWaterOrGroundLevel

This commit is contained in:
Ovahlord committed 2019-02-20 02:04:01 +01:00
1 parent 911f8636c9
commit 785b6c9837
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -2432,7 +2432,7 @@ bool Map::HasGrid(uint32 mapId, int32 gx, int32 gy) const
float Map::GetWaterOrGroundLevel(PhaseShift const& phaseShift, float x, float y, float z, float* ground /*= nullptr*/, bool /*swim = false*/, float collisionHeight /*= DEFAULT_COLLISION_HEIGHT*/) const
{
if (const_cast<Map*>(this)->GetGrid(x, y))
if (m_parentTerrainMap->GetGrid(x, y))
{
// we need ground level (including grid height version) for proper return water level in point
float ground_z = GetHeight(phaseShift, x, y, z + collisionHeight, true, 50.0f);