[11068] Prevent infinity creature fall at fail get heght.

Also fix wrong use INVALID_HEIGHT as height value.
It must be used only for _check_ height, and DON'T must use as real height value.
Must fix some wrong height check results.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
mns 2011-01-25 01:15:37 +03:00 committed by VladimirMangos
parent 21cc7cd179
commit d699d0973b
4 changed files with 9 additions and 7 deletions

View file

@ -44,7 +44,7 @@ GridMap::GridMap()
m_area_map = NULL;
// Height level data
m_gridHeight = INVALID_HEIGHT;
m_gridHeight = INVALID_HEIGHT_VALUE;
m_gridGetHeight = &GridMap::getHeightFromFlat;
m_V9 = NULL;
m_V8 = NULL;
@ -55,7 +55,7 @@ GridMap::GridMap()
m_liquid_offY = 0;
m_liquid_width = 0;
m_liquid_height = 0;
m_liquidLevel = INVALID_HEIGHT;
m_liquidLevel = INVALID_HEIGHT_VALUE;
m_liquid_type = NULL;
m_liquid_map = NULL;
}
@ -478,10 +478,10 @@ float GridMap::getLiquidLevel(float x, float y)
int cy_int = ((int)y & (MAP_RESOLUTION-1)) - m_liquid_offX;
if (cx_int < 0 || cx_int >=m_liquid_height)
return INVALID_HEIGHT;
return INVALID_HEIGHT_VALUE;
if (cy_int < 0 || cy_int >=m_liquid_width )
return INVALID_HEIGHT;
return INVALID_HEIGHT_VALUE;
return m_liquid_map[cx_int*m_liquid_width + cy_int];
}
@ -930,7 +930,7 @@ GridMapLiquidStatus TerrainInfo::getLiquidStatus(float x, float y, float z, uint
{
GridMapLiquidStatus result = LIQUID_MAP_NO_WATER;
VMAP::IVMapManager* vmgr = VMAP::VMapFactory::createOrGetVMapManager();
float liquid_level, ground_level = INVALID_HEIGHT;
float liquid_level, ground_level = INVALID_HEIGHT_VALUE;
uint32 liquid_type;
if (vmgr->GetLiquidLevel(GetMapId(), x, y, z, ReqLiquidType, liquid_level, ground_level, liquid_type))
{