diff options
author | megamage <none@none> | 2009-05-17 18:42:01 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-05-17 18:42:01 -0500 |
commit | 786083d8ccca797009d623f9b46defeed4553141 (patch) | |
tree | b8f4f6b487c3ec69d6c03d127f6d3cf929b269b0 | |
parent | ce0feb36eaeff21fd6e1a3179834354756e88c4e (diff) |
[7842] Set and stop combat for pets at player enter to GM-mode. Author: DonTomika
--HG--
branch : trunk
-rw-r--r-- | src/game/Player.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
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); |