Core/Players: out of range group updates will now get sent every 5 seconds instead of as soon as they are available to reflect retail behaivior.

Port From (https://github.com/TrinityCore/TrinityCore/commit/0d433b1bc89bf26585688d8041da500ff8dae364)
This commit is contained in:
hondacrx
2021-12-16 12:42:19 -05:00
parent 9ba51bd120
commit a39fdef7c3
2 changed files with 10 additions and 1 deletions
@@ -245,6 +245,8 @@ namespace Game.Entities
float[] m_powerFraction = new float[(int)PowerType.MaxPerClass]; float[] m_powerFraction = new float[(int)PowerType.MaxPerClass];
int[] m_MirrorTimer = new int[3]; int[] m_MirrorTimer = new int[3];
TimeTrackerSmall m_groupUpdateTimer;
ulong m_GuildIdInvited; ulong m_GuildIdInvited;
DeclinedName _declinedname; DeclinedName _declinedname;
Runes m_runes = new(); Runes m_runes = new();
+7
View File
@@ -121,6 +121,8 @@ namespace Game.Entities
m_bgData = new BGData(); m_bgData = new BGData();
_restMgr = new RestMgr(this); _restMgr = new RestMgr(this);
m_groupUpdateTimer = new(5000);
} }
public override void Dispose() public override void Dispose()
@@ -610,7 +612,12 @@ namespace Game.Entities
} }
// group update // group update
m_groupUpdateTimer.Update((int)diff);
if (m_groupUpdateTimer.Passed())
{
SendUpdateToOutOfRangeGroupMembers(); SendUpdateToOutOfRangeGroupMembers();
m_groupUpdateTimer.Reset(5000);
}
Pet pet = GetPet(); Pet pet = GetPet();
if (pet != null && !pet.IsWithinDistInMap(this, GetMap().GetVisibilityRange()) && !pet.IsPossessed()) if (pet != null && !pet.IsWithinDistInMap(this, GetMap().GetVisibilityRange()) && !pet.IsPossessed())