From 5b0896577f387d66bf1b8cfec523ac771d967773 Mon Sep 17 00:00:00 2001 From: Nefertumm Date: Sun, 24 Jul 2022 13:06:36 -0300 Subject: [PATCH] fix(Core): Crash on smart event: near players (#12479) --- src/server/game/AI/SmartScripts/SmartScript.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 6e0b8b1ef..9df81a469 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -3945,7 +3945,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui if (!units.empty()) { - if (unit->GetTypeId() != TYPEID_PLAYER) + if (!unit || unit->GetTypeId() != TYPEID_PLAYER) return; if (units.size() >= e.event.nearPlayer.minCount) @@ -3961,7 +3961,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui if (!units.empty()) { - if (unit->GetTypeId() != TYPEID_PLAYER) + if (!unit || unit->GetTypeId() != TYPEID_PLAYER) return; if (units.size() < e.event.nearPlayerNegation.minCount)