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:
@@ -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);
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user