[7842] Set and stop combat for pets at player enter to GM-mode. Author: DonTomika
--HG-- branch : trunk
This commit is contained in:
+13
-1
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user