Fix for potential recursive loops if using RemoveFromHateList() within EVENT_HATE_LIST.

Some work on Bazaar searching, but not functional yet.
This commit is contained in:
Trevius
2015-02-18 21:32:18 -06:00
parent 414db873b7
commit 3b45a66498
7 changed files with 119 additions and 58 deletions
+3 -3
View File
@@ -219,17 +219,17 @@ bool HateList::RemoveEntFromHateList(Mob *in_entity)
{
if ((*iterator)->entity_on_hatelist == in_entity)
{
if (in_entity)
parse->EventNPC(EVENT_HATE_LIST, hate_owner->CastToNPC(), in_entity, "0", 0);
is_found = true;
if (in_entity && in_entity->IsClient())
in_entity->CastToClient()->DecrementAggroCount();
delete (*iterator);
iterator = list.erase(iterator);
if (in_entity)
parse->EventNPC(EVENT_HATE_LIST, hate_owner->CastToNPC(), in_entity, "0", 0);
}
else
++iterator;