mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Units: Include SPELL_AURA_MOD_FACTION auras when restoring faction (either on aura removal or .gm off)
This commit is contained in:
@@ -2128,7 +2128,7 @@ void Player::SetGameMaster(bool on)
|
||||
PhasingHandler::SetAlwaysVisible(this, HasAuraType(SPELL_AURA_PHASE_ALWAYS_VISIBLE), false);
|
||||
|
||||
m_ExtraFlags &= ~ PLAYER_EXTRA_GM_ON;
|
||||
SetFactionForRace(GetRace());
|
||||
RestoreFaction();
|
||||
RemovePlayerFlag(PLAYER_FLAGS_GM);
|
||||
RemoveUnitFlag2(UNIT_FLAG2_ALLOW_CHEAT_SPELLS);
|
||||
|
||||
|
||||
@@ -11325,6 +11325,12 @@ void Unit::RemoveCharmedBy(Unit* charmer)
|
||||
|
||||
void Unit::RestoreFaction()
|
||||
{
|
||||
if (HasAuraType(SPELL_AURA_MOD_FACTION))
|
||||
{
|
||||
SetFaction(GetAuraEffectsByType(SPELL_AURA_MOD_FACTION).back()->GetMiscValue());
|
||||
return;
|
||||
}
|
||||
|
||||
if (GetTypeId() == TYPEID_PLAYER)
|
||||
ToPlayer()->SetFactionForRace(GetRace());
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user