aboutsummaryrefslogtreecommitdiff
path: root/src/common/Collision/Management/IVMapManager.h
diff options
context:
space:
mode:
authorTreeston <treeston.mmoc@gmail.com>2017-06-08 00:25:06 +0200
committerShauren <shauren.trinity@gmail.com>2017-06-08 00:25:06 +0200
commitf6c849729b27b77228704b595de3adaf24da2c10 (patch)
treeb9f7e1ae9c6db0aa367c353ebd2a3f5dddf860d1 /src/common/Collision/Management/IVMapManager.h
parent1660bb7d27d6f42b49012a6b57e3c2b2eab20fd3 (diff)
[3.3.5] Get zone/area IDs from vmap data in the liquid update (#19840)
* Add new method Map::getFullVMapDataForPosition to get area info and liquid info in a single vmap lookup * Use this lookup in Map:: relocation methods to update m_areaId and m_zoneId fields on WorldObject * Adjust GetZoneId/GetAreaId on WorldObject to always return these cached fields * Clean up liquid state handling on Unit and Player * Hand floor's Z coord up through GetFullTerrainStatusForPosition, use it to update a new field in WorldObject, and use that to feed a new GetFloorZ call on WorldObject. Closes #16489
Diffstat (limited to 'src/common/Collision/Management/IVMapManager.h')
-rw-r--r--src/common/Collision/Management/IVMapManager.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/common/Collision/Management/IVMapManager.h b/src/common/Collision/Management/IVMapManager.h
index 2188da1cadc..e77987a721d 100644
--- a/src/common/Collision/Management/IVMapManager.h
+++ b/src/common/Collision/Management/IVMapManager.h
@@ -22,6 +22,7 @@
#include <string>
#include "Define.h"
#include "ModelIgnoreFlags.h"
+#include "Common.h"
//===========================================================
@@ -49,6 +50,27 @@ namespace VMAP
#define VMAP_INVALID_HEIGHT -100000.0f // for check
#define VMAP_INVALID_HEIGHT_VALUE -200000.0f // real assigned value in unknown height case
+ struct AreaAndLiquidData
+ {
+ struct AreaInfo
+ {
+ AreaInfo(int32 _adtId, int32 _rootId, int32 _groupId, uint32 _flags) : adtId(_adtId), rootId(_rootId), groupId(_groupId), mogpFlags(_flags) { }
+ int32 const adtId;
+ int32 const rootId;
+ int32 const groupId;
+ uint32 const mogpFlags;
+ };
+ struct LiquidInfo
+ {
+ LiquidInfo(uint32 _type, float _level) : type(_type), level(_level) { }
+ uint32 const type;
+ float const level;
+ };
+
+ float floorZ = VMAP_INVALID_HEIGHT;
+ Optional<AreaInfo> areaInfo;
+ Optional<LiquidInfo> liquidInfo;
+ };
//===========================================================
class TC_COMMON_API IVMapManager
{
@@ -102,6 +124,8 @@ namespace VMAP
*/
virtual bool getAreaInfo(unsigned int pMapId, float x, float y, float &z, uint32 &flags, int32 &adtId, int32 &rootId, int32 &groupId) const=0;
virtual bool GetLiquidLevel(uint32 pMapId, float x, float y, float z, uint8 ReqLiquidType, float &level, float &floor, uint32 &type) const=0;
+ // get both area + liquid data in a single vmap lookup
+ virtual void getAreaAndLiquidData(unsigned int mapId, float x, float y, float z, uint8 reqLiquidType, AreaAndLiquidData& data) const=0;
};
}