diff options
| author | Shauren <shauren.trinity@gmail.com> | 2025-10-24 11:55:24 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2025-10-24 12:13:33 +0200 |
| commit | 429fdf992d831427c11d047300da0151ed581c04 (patch) | |
| tree | 8f1de282482969aab4159d642f5d78db84a6b7dd /src | |
| parent | b9e6a81f28d1fa7a50d0e6f0b08e100071430a5e (diff) | |
Core/SAI: Support SMART_EVENT_FLAG_ACTIONLIST_WAITS in movement fall action
Diffstat (limited to 'src')
| -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: |
