diff options
| -rw-r--r-- | src/server/game/AI/SmartScripts/SmartScript.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index e8cad28a4e8..ef87db7a692 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -2680,9 +2680,22 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u } case SMART_ACTION_FALL: { + std::shared_ptr<MultiActionResult<MovementStopReason>> waitEvent = CreateTimedActionListWaitEventFor<void, MultiActionResult<MovementStopReason>>(e, targets.size()); + for (WorldObject* target : targets) + { if (Unit* unitTarget = target->ToUnit()) - unitTarget->GetMotionMaster()->MoveFall(e.action.fall.pointId); + { + Optional<Scripting::v2::ActionResultSetter<MovementStopReason>> actionResultSetter; + if (waitEvent) + actionResultSetter = Scripting::v2::ActionResult<MovementStopReason>::GetResultSetter({ waitEvent, &waitEvent->Results.emplace_back() }); + + unitTarget->GetMotionMaster()->MoveFall(e.action.fall.pointId, std::move(actionResultSetter)); + } + } + + if (waitEvent && !waitEvent->Results.empty()) + mTimedActionWaitEvent = std::move(waitEvent); break; } default: |
