fix(Core/SmartScripts): null crash in SMART_TARGET_PLAYER_DISTANCE (#11442
This commit is contained in:
parent
33a70dbebc
commit
b801274b89
1 changed files with 2 additions and 0 deletions
|
|
@ -4514,6 +4514,8 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
|
|||
case SMART_TARGET_PLAYER_DISTANCE:
|
||||
{
|
||||
ObjectList* targets = GetTargets(e);
|
||||
if (!targets)
|
||||
return;
|
||||
for (WorldObject* target : *targets)
|
||||
{
|
||||
if (IsUnit(target) && me->IsFriendlyTo(target->ToUnit()) && target->ToUnit()->IsAlive() && target->ToUnit()->IsInCombat())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue