From 3f0f95976c05c3ccf4736c3fd876f83ee644dca6 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 10 Nov 2024 06:47:42 -0600 Subject: [PATCH] [Hotfix] ScanCloseMobs - Ensure scanning mob has an entity ID --- zone/entity.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/zone/entity.cpp b/zone/entity.cpp index d4b3ff72f..f53d4a723 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -2945,6 +2945,14 @@ void EntityList::RemoveAuraFromMobs(Mob *aura) // entity list (zone wide) void EntityList::ScanCloseMobs(Mob *scanning_mob) { + if (!scanning_mob) { + return; + } + + if (scanning_mob->GetID() <= 0) { + return; + } + float scan_range = RuleI(Range, MobCloseScanDistance) * RuleI(Range, MobCloseScanDistance); // Reserve memory in m_close_mobs to avoid frequent re-allocations if not already reserved.