From 7d13475bac68b873e36133f3190d21df10686f02 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Thu, 2 Mar 2017 14:31:48 -0500 Subject: [PATCH] Fix ClearAggro xtarget issue --- zone/entity.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/zone/entity.cpp b/zone/entity.cpp index 9f23f63a4..2bc1b99ed 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -2980,10 +2980,16 @@ void EntityList::Evade(Mob *who) //removes "targ" from all hate lists, including feigned, in the zone void EntityList::ClearAggro(Mob* targ) { + Client *c = nullptr; + if (targ->IsClient()) + c = targ->CastToClient(); auto it = npc_list.begin(); while (it != npc_list.end()) { - if (it->second->CheckAggro(targ)) + if (it->second->CheckAggro(targ)) { + if (c) + c->RemoveXTarget(it->second, false); it->second->RemoveFromHateList(targ); + } it->second->RemoveFromFeignMemory(targ->CastToClient()); //just in case we feigned ++it; }