mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 03:08:26 +00:00
[Bug Fix] Fix issue with IsEntOnHateList (#4097)
# Notes - We were not validating pointer in `IsEntOnHateList()`.
This commit is contained in:
+4
-6
@@ -73,20 +73,18 @@ void HateList::WipeHateList(bool npc_only) {
|
||||
}
|
||||
}
|
||||
|
||||
bool HateList::IsEntOnHateList(Mob *mob)
|
||||
bool HateList::IsEntOnHateList(Mob* m)
|
||||
{
|
||||
if (Find(mob))
|
||||
return true;
|
||||
return false;
|
||||
return m ? Find(m) != nullptr : false;
|
||||
}
|
||||
|
||||
struct_HateList* HateList::Find(Mob* m)
|
||||
{
|
||||
if (!m) {
|
||||
if (!m || list.empty()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
for (auto* e : list) {
|
||||
for (auto e : list) {
|
||||
if (e->entity_on_hatelist && e->entity_on_hatelist == m) {
|
||||
return e;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user