Core/AI: Clean up charm AI handling.

Port From (https://github.com/TrinityCore/TrinityCore/commit/e4e8c1c59c8b37216814526b4d2551f23934f465)
This commit is contained in:
hondacrx
2021-10-31 13:55:26 -04:00
parent 7050fda482
commit 26940fa650
33 changed files with 472 additions and 443 deletions
+2 -8
View File
@@ -390,14 +390,7 @@ namespace Game.Entities
aura.SetDuration(aura.GetSpellInfo().GetMaxDuration());
}
if (IsAIEnabled && GetAI() != null)
GetAI().UpdateAI(diff);
else if (NeedChangeAI)
{
UpdateCharmAI();
NeedChangeAI = false;
IsAIEnabled = GetAI() != null;
}
AIUpdateTick(diff);
// Update items that have just a limited lifetime
if (now > m_Last_tick)
@@ -5175,6 +5168,7 @@ namespace Game.Entities
if (guildId != 0)
{
SetUpdateFieldValue(m_values.ModifyValue(m_unitData).ModifyValue(m_unitData.GuildGUID), ObjectGuid.Create(HighGuid.Guild, guildId));
SetUpdateFieldValue(m_values.ModifyValue(m_activePlayerData).ModifyValue(m_activePlayerData.GuildClubMemberID), GetGUID().GetCounter());
AddPlayerFlag(PlayerFlags.GuildLevelEnabled);
}
else