mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-14 19:51:29 +00:00
[Bug Fix] Fix bots/Mercenaries being removed from hatelist (#3708)
# Notes - https://github.com/EQEmu/Server/pull/3595 caused bots, bot pets, and mercenaries to be removed from hate list because we were only checking for `IsClient()` not `IsOfClientBotMerc()`. - Resolves an issue mentioned [here](https://discord.com/channels/212663220849213441/1177288302383079534) where NPCs would run past bots/mercenaries to attack the owner.
This commit is contained in:
parent
ebeaef598b
commit
6d8e80b1e5
@ -46,7 +46,14 @@ void HateList::WipeHateList(bool npc_only) {
|
|||||||
auto iterator = list.begin();
|
auto iterator = list.begin();
|
||||||
while (iterator != list.end()) {
|
while (iterator != list.end()) {
|
||||||
Mob *m = (*iterator)->entity_on_hatelist;
|
Mob *m = (*iterator)->entity_on_hatelist;
|
||||||
if (m && (m->IsClient() || (m->IsPet() && m->GetOwner()->IsClient())) && npc_only) {
|
if (
|
||||||
|
m &&
|
||||||
|
(
|
||||||
|
m->IsOfClientBotMerc() ||
|
||||||
|
(m->IsPet() && m->GetOwner() && m->GetOwner()->IsOfClientBotMerc())
|
||||||
|
) &&
|
||||||
|
npc_only
|
||||||
|
) {
|
||||||
iterator++;
|
iterator++;
|
||||||
} else {
|
} else {
|
||||||
if (m) {
|
if (m) {
|
||||||
@ -58,6 +65,7 @@ void HateList::WipeHateList(bool npc_only) {
|
|||||||
m->CastToClient()->DecrementAggroCount();
|
m->CastToClient()->DecrementAggroCount();
|
||||||
m->CastToClient()->RemoveXTarget(hate_owner, true);
|
m->CastToClient()->RemoveXTarget(hate_owner, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
delete (*iterator);
|
delete (*iterator);
|
||||||
iterator = list.erase(iterator);
|
iterator = list.erase(iterator);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user