From dd913de1a2b057ccb5bdbe3a782ca00fb5d4cb07 Mon Sep 17 00:00:00 2001 From: mackal Date: Fri, 22 Feb 2013 22:27:03 -0500 Subject: [PATCH] Mobs will now be removed from XTarget when they clear their feign memory aggro --- changelog.txt | 3 +++ zone/aggro.cpp | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/changelog.txt b/changelog.txt index ec2dd3956..e24608451 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,8 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- +== 02/22/2013 == +demonstar55: Mobs will now be removed from XTargets when they get back to their way point, should be last instance of XTarget mobs not clearing when they are not aggroed anymore + == 02/19/2013 == Derision: World should no longer crash if the start_zone query fails at character creation. diff --git a/zone/aggro.cpp b/zone/aggro.cpp index 422dd591f..d7548b705 100644 --- a/zone/aggro.cpp +++ b/zone/aggro.cpp @@ -1422,6 +1422,17 @@ void Mob::RemoveFromFeignMemory(Client* attacker) { } void Mob::ClearFeignMemory() { + std::set::iterator RememberedCharID; + RememberedCharID = feign_memory_list.begin(); + + while (RememberedCharID != feign_memory_list.end()) + { + Client* remember_client = entity_list.GetClientByCharID(*RememberedCharID); + if(remember_client != NULL) //Still in zone + remember_client->RemoveXTarget(this, false); + RememberedCharID++; + } + feign_memory_list.clear(); minLastFightingDelayMoving = RuleI(NPC, LastFightingDelayMovingMin); maxLastFightingDelayMoving = RuleI(NPC, LastFightingDelayMovingMax);