From 786083d8ccca797009d623f9b46defeed4553141 Mon Sep 17 00:00:00 2001 From: megamage Date: Sun, 17 May 2009 18:42:01 -0500 Subject: [7842] Set and stop combat for pets at player enter to GM-mode. Author: DonTomika --HG-- branch : trunk --- src/game/Player.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 483d62d55cf..586396769d6 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -2137,11 +2137,17 @@ void Player::SetGameMaster(bool on) setFaction(35); 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); ResetContestedPvP(); getHostilRefManager().setOnlineOfflineState(false); - CombatStop(); + CombatStopWithPets(); SetPhaseMask(PHASEMASK_ANYWHERE,false); // see and visible in all phases } @@ -2155,6 +2161,12 @@ void Player::SetGameMaster(bool on) setFactionForRace(getRace()); RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_GM); + if (Pet* pet = GetPet()) + { + pet->setFaction(getFaction()); + pet->getHostilRefManager().setOnlineOfflineState(true); + } + // restore FFA PvP Server state if(sWorld.IsFFAPvPRealm()) SetByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP); -- cgit v1.2.3