mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +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);
|
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
|
||||||
}
|
}
|
||||||
|
|
@ -2091,6 +2097,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);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "7841"
|
#define REVISION_NR "7842"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue