From 563f7d5564ec39a946429af7209600f6424d1fa4 Mon Sep 17 00:00:00 2001 From: nytmyr <53322305+nytmyr@users.noreply.github.com> Date: Mon, 22 Jul 2024 11:51:41 -0500 Subject: [PATCH] [Cleanup] Mask GM Show Buff message behind EntityVariable (#4419) * [Cleanup] Mask GM Show Buff message behind EntityVariable Removes the spam of "Your GM flag allows you to always see your targets' buffs." for GMs every time a buff lands on a target. It will now lock to an Entity Variable and only show once per zone. * Convert string to constexpr * Switch from string to char --- zone/client_packet.cpp | 2 ++ zone/entity.cpp | 5 ++++- zone/entity.h | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 572597710..9d71d62ed 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -793,6 +793,8 @@ void Client::CompleteConnect() parse->EventPlayer(EVENT_ENTER_ZONE, this, "", 0); } + DeleteEntityVariable(SEE_BUFFS_FLAG); + // the way that the client deals with positions during the initial spawn struct // is subtly different from how it deals with getting a position update // if a mob is slightly in the wall or slightly clipping a floor they will be diff --git a/zone/entity.cpp b/zone/entity.cpp index b99ce65ca..b0a52d611 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -1655,7 +1655,10 @@ void EntityList::QueueClientsByTarget(Mob *sender, const EQApplicationPacket *ap Send = clear_target_window; if (c->GetGM() || RuleB(Spells, AlwaysSendTargetsBuffs)) { if (c->GetGM()) { - c->Message(Chat::White, "Your GM flag allows you to always see your targets' buffs."); + if (!c->EntityVariableExists(SEE_BUFFS_FLAG)) { + c->Message(Chat::White, "Your GM flag allows you to always see your targets' buffs."); + c->SetEntityVariable(SEE_BUFFS_FLAG, "1"); + } } Send = !clear_target_window; diff --git a/zone/entity.h b/zone/entity.h index c38013ab4..f987eebbb 100644 --- a/zone/entity.h +++ b/zone/entity.h @@ -60,6 +60,8 @@ class Bot; extern EntityList entity_list; +constexpr const char* SEE_BUFFS_FLAG = "see_buffs_flag"; + class Entity { public: