Core/Units: Include SPELL_AURA_MOD_FACTION auras when restoring faction (either on aura removal or .gm off)

Port From (https://github.com/TrinityCore/TrinityCore/commit/52fb46703172a0803a122d54aaed6506eb25d3e3)
This commit is contained in:
hondacrx
2022-05-31 13:58:34 -04:00
parent ad54cfb453
commit 3edf7d0b91
2 changed files with 7 additions and 1 deletions
+1 -1
View File
@@ -2192,7 +2192,7 @@ namespace Game.Entities
PhasingHandler.SetAlwaysVisible(this, HasAuraType(AuraType.PhaseAlwaysVisible), false);
m_ExtraFlags &= ~PlayerExtraFlags.GMOn;
SetFactionForRace(GetRace());
RestoreFaction();
RemovePlayerFlag(PlayerFlags.GM);
RemoveUnitFlag2(UnitFlags2.AllowCheatSpells);
+6
View File
@@ -2107,6 +2107,12 @@ namespace Game.Entities
public void RestoreFaction()
{
if (HasAuraType(AuraType.ModFaction))
{
SetFaction((uint)GetAuraEffectsByType(AuraType.ModFaction).LastOrDefault().GetMiscValue());
return;
}
if (IsTypeId(TypeId.Player))
ToPlayer().SetFactionForRace(GetRace());
else