mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2025-12-01 21:13:04 +08:00
fix(Core/SmartScripts): null crash in SMART_TARGET_PLAYER_DISTANCE (#11442
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user