From 2cc61ef8c1cf8d567981acdf7abc3585b9cc8c59 Mon Sep 17 00:00:00 2001 From: catapultam-habeo <97849758+catapultam-habeo@users.noreply.github.com> Date: Sat, 4 Mar 2023 10:40:29 -0600 Subject: [PATCH] [Bug Fix] Ensure synchronization of pet taunt state with UI (#3025) * fix to desync between pet taunt state and button * Update npc.h * Update npc.cpp * Update npc.h --------- Co-authored-by: Alex King <89047260+Kinglykrab@users.noreply.github.com> --- zone/npc.cpp | 8 ++++++++ zone/npc.h | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/zone/npc.cpp b/zone/npc.cpp index b683b1bd9..8168e1e32 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -3963,3 +3963,11 @@ void NPC::HandleRoambox() return; } + +void NPC::SetTaunting(bool is_taunting) { + taunting = is_taunting; + + if (IsPet() && IsPetOwnerClient()) { + GetOwner()->CastToClient()->SetPetCommandState(PET_BUTTON_TAUNT, is_taunting); + } +} diff --git a/zone/npc.h b/zone/npc.h index 9a703cf7b..d84d17da6 100644 --- a/zone/npc.h +++ b/zone/npc.h @@ -310,7 +310,7 @@ public: uint16 GetPetSpellID() const {return pet_spell_id;} void SetPetSpellID(uint16 amt) {pet_spell_id = amt;} uint32 GetMaxDamage(uint8 tlevel); - void SetTaunting(bool tog) {taunting = tog;} + void SetTaunting(bool is_taunting); bool IsTaunting() const { return taunting; } void PickPocket(Client* thief); void Disarm(Client* client, int chance);