diff options
author | Treeston <treeston.mmoc@gmail.com> | 2017-06-08 00:25:06 +0200 |
---|---|---|
committer | Carbenium <carbenium@outlook.com> | 2020-07-16 22:00:24 +0200 |
commit | 51ce3b1c1dc6a53938ed6f240bac00681d18a44f (patch) | |
tree | cd6415f3c7a1dc12cc003a707b16fb0e1cd468eb /src/common/Collision/Management/IVMapManager.h | |
parent | f7a7d02a7f50400cdc2be3c4722afeefe7efce80 (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
(cherry picked from commit f6c849729b27b77228704b595de3adaf24da2c10)
Diffstat (limited to 'src/common/Collision/Management/IVMapManager.h')
-rw-r--r-- | src/common/Collision/Management/IVMapManager.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/common/Collision/Management/IVMapManager.h b/src/common/Collision/Management/IVMapManager.h index 809675ec75a..296a1574c0a 100644 --- a/src/common/Collision/Management/IVMapManager.h +++ b/src/common/Collision/Management/IVMapManager.h @@ -21,6 +21,7 @@ #include <string> #include "Define.h" #include "ModelIgnoreFlags.h" +#include "Optional.h" //=========================================================== @@ -48,6 +49,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 { @@ -101,6 +123,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; }; } |