Rework how XTarget auto haters work

This should cause the auto haters to be shared with other toons who might be
interested (group/raid) like live.

There maybe some bugs since there is a lot of complex interactions here.
This commit is contained in:
Michael Cook (mackal)
2017-02-17 21:04:48 -05:00
parent 8177f7d9bb
commit 9f4604ec3e
14 changed files with 435 additions and 71 deletions
+6 -4
View File
@@ -1404,15 +1404,15 @@ void EntityList::RemoveFromTargets(Mob *mob, bool RemoveFromXTargets)
if (!m)
continue;
m->RemoveFromHateList(mob);
if (RemoveFromXTargets) {
if (m->IsClient())
if (m->IsClient() && mob->CheckAggro(m))
m->CastToClient()->RemoveXTarget(mob, false);
// FadingMemories calls this function passing the client.
else if (mob->IsClient())
else if (mob->IsClient() && m->CheckAggro(mob))
mob->CastToClient()->RemoveXTarget(m, false);
}
m->RemoveFromHateList(mob);
}
}
@@ -2557,6 +2557,8 @@ void EntityList::RemoveFromHateLists(Mob *mob, bool settoone)
it->second->RemoveFromHateList(mob);
else
it->second->SetHateAmountOnEnt(mob, 1);
if (mob->IsClient())
mob->CastToClient()->RemoveXTarget(it->second, false); // gotta do book keeping
}
++it;
}