mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-28 16:16:27 +00:00
feat(Core/Command): add GM spectator to allow cross-faction /follow (#22393)
This commit is contained in:
@@ -597,6 +597,7 @@ enum PlayerExtraFlags
|
||||
PLAYER_EXTRA_SPECTATOR_ON = 0x0080, // Marks if player is spectactor
|
||||
PLAYER_EXTRA_PVP_DEATH = 0x0100, // store PvP death status until corpse creating.
|
||||
PLAYER_EXTRA_SHOW_DK_PET = 0x0400, // Marks if player should see ghoul on login screen
|
||||
PLAYER_EXTRA_GM_SPECTATOR = 0x0800,
|
||||
};
|
||||
|
||||
// 2^n values
|
||||
@@ -1177,6 +1178,9 @@ public:
|
||||
void SetGameMaster(bool on);
|
||||
[[nodiscard]] bool isGMChat() const { return m_ExtraFlags & PLAYER_EXTRA_GM_CHAT; }
|
||||
void SetGMChat(bool on) { if (on) m_ExtraFlags |= PLAYER_EXTRA_GM_CHAT; else m_ExtraFlags &= ~PLAYER_EXTRA_GM_CHAT; }
|
||||
[[nodiscard]] bool IsGMSpectator() const { return m_ExtraFlags & PLAYER_EXTRA_GM_SPECTATOR; }
|
||||
void SetGMSpectator(bool on) { if (on) m_ExtraFlags |= PLAYER_EXTRA_GM_SPECTATOR; else m_ExtraFlags &= ~PLAYER_EXTRA_GM_SPECTATOR; }
|
||||
|
||||
[[nodiscard]] bool isTaxiCheater() const { return m_ExtraFlags & PLAYER_EXTRA_TAXICHEAT; }
|
||||
void SetTaxiCheater(bool on) { if (on) m_ExtraFlags |= PLAYER_EXTRA_TAXICHEAT; else m_ExtraFlags &= ~PLAYER_EXTRA_TAXICHEAT; }
|
||||
[[nodiscard]] bool isGMVisible() const { return !(m_ExtraFlags & PLAYER_EXTRA_GM_INVISIBLE); }
|
||||
|
||||
@@ -20791,6 +20791,10 @@ void Unit::PatchValuesUpdate(ByteBuffer& valuesUpdateBuf, BuildValuesCachePosPoi
|
||||
{
|
||||
valuesUpdateBuf.put(posPointers.UnitFieldFactionTemplatePos, uint32(target->GetFaction()));
|
||||
}
|
||||
else if (target->IsGMSpectator() && IsControlledByPlayer())
|
||||
{
|
||||
valuesUpdateBuf.put(posPointers.UnitFieldFactionTemplatePos, uint32(target->GetFaction()));
|
||||
}
|
||||
}
|
||||
|
||||
sScriptMgr->OnPatchValuesUpdate(this, valuesUpdateBuf, posPointers, target);
|
||||
|
||||
Reference in New Issue
Block a user