mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 09:31:30 +00:00
[Bug Fix] Fix issue with IsEntOnHateList (#4097)
# Notes - We were not validating pointer in `IsEntOnHateList()`.
This commit is contained in:
parent
767846f7e5
commit
6ec63969bb
@ -73,20 +73,18 @@ void HateList::WipeHateList(bool npc_only) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool HateList::IsEntOnHateList(Mob *mob)
|
bool HateList::IsEntOnHateList(Mob* m)
|
||||||
{
|
{
|
||||||
if (Find(mob))
|
return m ? Find(m) != nullptr : false;
|
||||||
return true;
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct_HateList* HateList::Find(Mob* m)
|
struct_HateList* HateList::Find(Mob* m)
|
||||||
{
|
{
|
||||||
if (!m) {
|
if (!m || list.empty()) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto* e : list) {
|
for (auto e : list) {
|
||||||
if (e->entity_on_hatelist && e->entity_on_hatelist == m) {
|
if (e->entity_on_hatelist && e->entity_on_hatelist == m) {
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -48,7 +48,7 @@ public:
|
|||||||
Mob *GetMobWithMostHateOnList(bool skip_mezzed = false);
|
Mob *GetMobWithMostHateOnList(bool skip_mezzed = false);
|
||||||
Mob *GetEscapingMobOnHateList(Mob *center, float range = 0.0f, bool first = false);
|
Mob *GetEscapingMobOnHateList(Mob *center, float range = 0.0f, bool first = false);
|
||||||
|
|
||||||
bool IsEntOnHateList(Mob *mob);
|
bool IsEntOnHateList(Mob* m);
|
||||||
bool IsHateListEmpty();
|
bool IsHateListEmpty();
|
||||||
bool RemoveEntFromHateList(Mob *ent);
|
bool RemoveEntFromHateList(Mob *ent);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user