From 7727a09dc8b194e6de67522ccb1752eb4bf18f44 Mon Sep 17 00:00:00 2001 From: Jelle Meeus Date: Tue, 18 Mar 2025 16:39:55 +0100 Subject: [PATCH] fix(Scripts/Outland): add missing `return` if no target is found (#21731) --- .../SunwellPlateau/instance_sunwell_plateau.cpp | 3 +++ src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp index b0d51b814..1f9fa5a87 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp @@ -184,7 +184,10 @@ struct npc_sunblade_scout : public ScriptedAI protectors.remove_if([](Creature* trigger) {return !trigger->HasAura(SPELL_COSMETIC_STUN_IMMUNE_PERMANENT);}); protectors.sort(Acore::ObjectDistanceOrderPred(me)); if (protectors.empty()) + { ScheduleCombat(); + return; + } Creature* closestProtector = protectors.front(); me->GetMotionMaster()->MoveFollow(closestProtector, 0.0f, 0.0f); _protectorGUID = closestProtector->GetGUID(); diff --git a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp index 9edac602a..55e4f8039 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp @@ -757,7 +757,10 @@ struct npc_amanishi_scout : public ScriptedAI triggers.remove_if([](Creature* trigger) {return !IsDrum(trigger);}); triggers.sort(Acore::ObjectDistanceOrderPred(me)); if (triggers.empty()) + { ScheduleCombat(); + return; + } Creature* closestDrum = triggers.front(); me->GetMotionMaster()->MoveFollow(closestDrum, 0.0f, 0.0f); _drumGUID = closestDrum->GetGUID();