Fixed build, thanks Amit86 for noticing

This commit is contained in:
Subv
2012-02-14 13:47:35 -05:00
parent d55126aacb
commit f8df838db9
3 changed files with 12 additions and 12 deletions
+9 -9
View File
@@ -1038,7 +1038,7 @@ GridMap::GridMap()
_liquidWidth = 0; _liquidWidth = 0;
_liquidHeight = 0; _liquidHeight = 0;
_liquidLevel = INVALID_HEIGHT; _liquidLevel = INVALID_HEIGHT;
_liquidType = NULL; _liquidData = NULL;
_liquidMap = NULL; _liquidMap = NULL;
} }
@@ -1100,12 +1100,12 @@ void GridMap::unloadData()
delete[] _areaMap; delete[] _areaMap;
delete[] m_V9; delete[] m_V9;
delete[] m_V8; delete[] m_V8;
delete[] _liquidType; delete[] _liquidData;
delete[] _liquidMap; delete[] _liquidMap;
_areaMap = NULL; _areaMap = NULL;
m_V9 = NULL; m_V9 = NULL;
m_V8 = NULL; m_V8 = NULL;
_liquidType = NULL; _liquidData = NULL;
_liquidMap = NULL; _liquidMap = NULL;
_gridGetHeight = &GridMap::getHeightFromFlat; _gridGetHeight = &GridMap::getHeightFromFlat;
} }
@@ -1191,8 +1191,8 @@ bool GridMap::loadLiquidData(FILE* in, uint32 offset, uint32 /*size*/)
if (!(header.flags & MAP_LIQUID_NO_TYPE)) if (!(header.flags & MAP_LIQUID_NO_TYPE))
{ {
_liquidType = new uint8 [16*16]; _liquidData = new uint8 [16*16];
if (fread(_liquidType, sizeof(uint8), 16*16, in) != 16*16) if (fread(_liquidData, sizeof(uint8), 16*16, in) != 16*16)
return false; return false;
} }
if (!(header.flags & MAP_LIQUID_NO_HEIGHT)) if (!(header.flags & MAP_LIQUID_NO_HEIGHT))
@@ -1458,21 +1458,21 @@ float GridMap::getLiquidLevel(float x, float y)
uint8 GridMap::getTerrainType(float x, float y) uint8 GridMap::getTerrainType(float x, float y)
{ {
if (!_liquidType) if (!_liquidData)
return 0; return 0;
x = 16 * (32 - x/SIZE_OF_GRIDS); x = 16 * (32 - x/SIZE_OF_GRIDS);
y = 16 * (32 - y/SIZE_OF_GRIDS); y = 16 * (32 - y/SIZE_OF_GRIDS);
int lx = (int)x & 15; int lx = (int)x & 15;
int ly = (int)y & 15; int ly = (int)y & 15;
return _liquidType[lx*16 + ly]; return _liquidData[lx*16 + ly];
} }
// Get water state on map // Get water state on map
inline ZLiquidStatus GridMap::getLiquidStatus(float x, float y, float z, uint8 ReqLiquidType, LiquidData* data) inline ZLiquidStatus GridMap::getLiquidStatus(float x, float y, float z, uint8 ReqLiquidType, LiquidData* data)
{ {
// Check water type (if no water return) // Check water type (if no water return)
if (!_liquidType && !_liquidType) if (!_liquidType && !_liquidData)
return LIQUID_MAP_NO_WATER; return LIQUID_MAP_NO_WATER;
// Get cell // Get cell
@@ -1483,7 +1483,7 @@ inline ZLiquidStatus GridMap::getLiquidStatus(float x, float y, float z, uint8 R
int y_int = (int)cy & (MAP_RESOLUTION-1); int y_int = (int)cy & (MAP_RESOLUTION-1);
// Check water type in cell // Check water type in cell
uint8 type = _liquidType ? _liquidType[(x_int>>3)*16 + (y_int>>3)] : _liquidType; uint8 type = _liquidData ? _liquidData[(x_int>>3)*16 + (y_int>>3)] : _liquidType;
if (type == 0) if (type == 0)
return LIQUID_MAP_NO_WATER; return LIQUID_MAP_NO_WATER;
+1 -1
View File
@@ -163,7 +163,7 @@ class GridMap
// Liquid data // Liquid data
float _liquidLevel; float _liquidLevel;
uint8* _liquidType; uint8* _liquidData;
float* _liquidMap; float* _liquidMap;
uint16 _gridArea; uint16 _gridArea;
uint16 _liquidType; uint16 _liquidType;
+2 -2
View File
@@ -82,7 +82,7 @@ class MotionMaster //: private std::stack<MovementGenerator *>
{ {
private: private:
//typedef std::stack<MovementGenerator *> Impl; //typedef std::stack<MovementGenerator *> Impl;
typedef std::vector<_Ty> ExpireList; typedef MovementGenerator* _Ty;
void pop() { Impl[_top] = NULL; --_top; } void pop() { Impl[_top] = NULL; --_top; }
void push(_Ty _Val) { ++_top; Impl[_top] = _Val; } void push(_Ty _Val) { ++_top; Impl[_top] = _Val; }
@@ -183,8 +183,8 @@ class MotionMaster //: private std::stack<MovementGenerator *>
void DirectExpire(bool reset); void DirectExpire(bool reset);
void DelayedExpire(); void DelayedExpire();
typedef std::vector<_Ty> ExpireList;
ExpireList* _expList; ExpireList* _expList;
typedef MovementGenerator* _Ty;
_Ty Impl[MAX_MOTION_SLOT]; _Ty Impl[MAX_MOTION_SLOT];
int _top; int _top;
Unit* _owner; Unit* _owner;