mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[7842] Set and stop combat for pets at player enter to GM-mode.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
b7f09eb37c
commit
ab3eb09669
2 changed files with 14 additions and 2 deletions
|
|
@ -2073,11 +2073,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
|
||||
}
|
||||
|
|
@ -2091,6 +2097,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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue