Core/Objects: cache current liquid status of objects when updating position data and use it to replace unnecessary vmap lookups (#24399)

* dropped unneeded IsUnderwater override for players since the default position data update considers collision height already so we don't have to rely on that tempfix anymore. This actually fixes breathing bars showing up depending on your characters size (gnomes get their breathing bar earlier, taurens later etc)

(cherry picked from commit bea850fb73)
This commit is contained in:
Ovah
2020-04-07 23:28:44 +02:00
committed by Shauren
parent fa1eb9f36f
commit d18d2b84f2
6 changed files with 36 additions and 64 deletions
+3 -2
View File
@@ -796,8 +796,8 @@ void MovementInfo::OutDebug()
WorldObject::WorldObject(bool isWorldObject) : Object(), WorldLocation(), LastUsedScriptID(0),
m_movementInfo(), m_name(), m_isActive(false), m_isFarVisible(false), m_isWorldObject(isWorldObject), m_zoneScript(nullptr),
m_transport(nullptr), m_zoneId(0), m_areaId(0), m_staticFloorZ(VMAP_INVALID_HEIGHT), m_outdoors(false), m_currMap(nullptr), m_InstanceId(0),
_dbPhase(0), m_notifyflags(0)
m_transport(nullptr), m_zoneId(0), m_areaId(0), m_staticFloorZ(VMAP_INVALID_HEIGHT), m_outdoors(false), m_liquidStatus(LIQUID_MAP_NO_WATER),
m_currMap(nullptr), m_InstanceId(0), _dbPhase(0), m_notifyflags(0)
{
m_serverSideVisibility.SetValue(SERVERSIDE_VISIBILITY_GHOST, GHOST_VISIBILITY_ALIVE | GHOST_VISIBILITY_GHOST);
m_serverSideVisibilityDetect.SetValue(SERVERSIDE_VISIBILITY_GHOST, GHOST_VISIBILITY_ALIVE);
@@ -896,6 +896,7 @@ void WorldObject::ProcessPositionDataChanged(PositionFullTerrainStatus const& da
m_zoneId = area->ParentAreaID;
m_outdoors = data.outdoors;
m_staticFloorZ = data.floorZ;
m_liquidStatus = data.liquidStatus;
}
void WorldObject::AddToWorld()