Core/Player: moved the periodic group update mechanic into heartbeat handling
Port From (https://github.com/TrinityCore/TrinityCore/commit/80d72a2c913657d3bbea538cfb842de3fa55dc50)
This commit is contained in:
@@ -236,8 +236,6 @@ namespace Game.Entities
|
||||
float[] m_powerFraction = new float[(int)PowerType.MaxPerClass];
|
||||
int[] m_MirrorTimer = new int[3];
|
||||
|
||||
TimeTracker m_groupUpdateTimer;
|
||||
|
||||
ulong m_GuildIdInvited;
|
||||
Runes m_runes = new();
|
||||
uint m_hostileReferenceCheckTimer;
|
||||
|
||||
@@ -114,8 +114,6 @@ namespace Game.Entities
|
||||
m_bgData = new BGData();
|
||||
|
||||
_restMgr = new RestMgr(this);
|
||||
|
||||
m_groupUpdateTimer = new(5000);
|
||||
}
|
||||
|
||||
public override void Dispose()
|
||||
@@ -541,14 +539,6 @@ namespace Game.Entities
|
||||
}
|
||||
}
|
||||
|
||||
// group update
|
||||
m_groupUpdateTimer.Update(diff);
|
||||
if (m_groupUpdateTimer.Passed())
|
||||
{
|
||||
SendUpdateToOutOfRangeGroupMembers();
|
||||
m_groupUpdateTimer.Reset(5000);
|
||||
}
|
||||
|
||||
Pet pet = GetPet();
|
||||
if (pet != null && !pet.IsWithinDistInMap(this, GetMap().GetVisibilityRange()) && !pet.IsPossessed())
|
||||
RemovePet(pet, PetSaveMode.NotInSlot, true);
|
||||
@@ -571,6 +561,14 @@ namespace Game.Entities
|
||||
TeleportTo(teleportDest, m_teleport_options);
|
||||
}
|
||||
|
||||
public override void Heartbeat()
|
||||
{
|
||||
base.Heartbeat();
|
||||
|
||||
// Group update
|
||||
SendUpdateToOutOfRangeGroupMembers();
|
||||
}
|
||||
|
||||
public override void SetDeathState(DeathState s)
|
||||
{
|
||||
bool oldIsAlive = IsAlive();
|
||||
|
||||
Reference in New Issue
Block a user