[7842] Set and stop combat for pets at player enter to GM-mode. Author: DonTomika

--HG--
branch : trunk
This commit is contained in:
megamage
2009-05-17 18:42:01 -05:00
parent ce0feb36ea
commit 786083d8cc
+13 -1
View File
@@ -2137,11 +2137,17 @@ void Player::SetGameMaster(bool on)
setFaction(35); setFaction(35);
SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_GM); SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_GM);
if (Pet* pet = GetPet())
{
pet->setFaction(35);
pet->getHostilRefManager().setOnlineOfflineState(false);
}
RemoveByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP); RemoveByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP);
ResetContestedPvP(); ResetContestedPvP();
getHostilRefManager().setOnlineOfflineState(false); getHostilRefManager().setOnlineOfflineState(false);
CombatStop(); CombatStopWithPets();
SetPhaseMask(PHASEMASK_ANYWHERE,false); // see and visible in all phases SetPhaseMask(PHASEMASK_ANYWHERE,false); // see and visible in all phases
} }
@@ -2155,6 +2161,12 @@ void Player::SetGameMaster(bool on)
setFactionForRace(getRace()); setFactionForRace(getRace());
RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_GM); RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_GM);
if (Pet* pet = GetPet())
{
pet->setFaction(getFaction());
pet->getHostilRefManager().setOnlineOfflineState(true);
}
// restore FFA PvP Server state // restore FFA PvP Server state
if(sWorld.IsFFAPvPRealm()) if(sWorld.IsFFAPvPRealm())
SetByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP); SetByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP);