Core/Objects: ported Heartbeat implementation fron master branch

This commit is contained in:
Ovahlord committed 2025-03-09 02:40:05 +01:00
1 parent 352ce7e1b3
commit e8588fd5ba
30 files changed
+257 -184

No files matched your search

+15 -1
View File
@@ -101,6 +101,18 @@ WorldObject::~WorldObject()
}
}
void WorldObject::Update(uint32 diff)
{
m_Events.Update(diff);
_heartbeatTimer -= Milliseconds(diff);
while (_heartbeatTimer <= 0ms)
{
_heartbeatTimer += HEARTBEAT_INTERVAL;
Heartbeat();
}
}
Object::~Object()
{
if (IsInWorld())
@@ -1117,7 +1129,7 @@ bool Object::PrintIndexError(uint32 index, bool set) const
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(true), m_liquidStatus(LIQUID_MAP_NO_WATER),
m_wmoGroupID(0), m_currMap(nullptr), m_InstanceId(0), _dbPhase(0), m_notifyflags(0),
m_wmoGroupID(0), m_currMap(nullptr), m_InstanceId(0), _dbPhase(0), m_notifyflags(0), _heartbeatTimer(HEARTBEAT_INTERVAL),
m_aiAnimKitId(0), m_movementAnimKitId(0), m_meleeAnimKitId(0)
{
m_serverSideVisibility.SetValue(SERVERSIDE_VISIBILITY_GHOST, GHOST_VISIBILITY_ALIVE | GHOST_VISIBILITY_GHOST);
@@ -1190,6 +1202,8 @@ void WorldObject::CleanupsBeforeDelete(bool /*finalCleanup*/)
if (TransportBase* transport = GetTransport())
transport->RemovePassenger(this);
m_Events.KillAllEvents(false); // non-delatable (currently cast spells) will not deleted now but it will deleted at call in Map::RemoveAllObjectsInRemoveList
}
void WorldObject::_Create(ObjectGuid::LowType guidlow, HighGuid guidhigh)