fix(Core): Crash on smart event: near players (#12479)

This commit is contained in:
Nefertumm
2022-07-24 13:06:36 -03:00
committed by GitHub
parent f0777d1fd3
commit 5b0896577f

View File

@@ -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)