refactor(Core/Player): add helper method for PLAYER_FLAGS_DEVELOPER (#4395)

Co-Authored-By: ForesterDev <11771800+ForesterDev@users.noreply.github.com>
This commit is contained in:
Kitzunu
2021-02-08 22:55:04 +01:00
committed by GitHub
parent 736def2058
commit 05a8217270
4 changed files with 15 additions and 14 deletions

View File

@@ -2210,7 +2210,7 @@ uint8 Player::GetChatTag() const
tag |= CHAT_TAG_DND;
if (isAFK())
tag |= CHAT_TAG_AFK;
if (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_DEVELOPER))
if (IsDeveloper())
tag |= CHAT_TAG_DEV;
return tag;

View File

@@ -1173,6 +1173,9 @@ public:
void CleanupAfterTaxiFlight();
void ContinueTaxiFlight();
// mount_id can be used in scripting calls
[[nodiscard]] bool IsDeveloper() const { return HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_DEVELOPER); }
void SetDeveloper(bool on) { ApplyModFlag(PLAYER_FLAGS, PLAYER_FLAGS_DEVELOPER, on); }
[[nodiscard]] bool isAcceptWhispers() const { return m_ExtraFlags & PLAYER_EXTRA_ACCEPT_WHISPERS; }
void SetAcceptWhispers(bool on) { if (on) m_ExtraFlags |= PLAYER_EXTRA_ACCEPT_WHISPERS; else m_ExtraFlags &= ~PLAYER_EXTRA_ACCEPT_WHISPERS; }
[[nodiscard]] bool IsGameMaster() const { return m_ExtraFlags & PLAYER_EXTRA_GM_ON; }