New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trigger.OnPassengerExited runs before the exit-transport activity is queued #15736

Open
pchote opened this Issue Oct 26, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@pchote
Member

pchote commented Oct 26, 2018

This then cancels any activities that may have been queued by the trigger callback.

Testcase: nod07b, SendReinforcementsWave (engineer capturing).

The following workaround solves the issue for this mission, but it really should be fixed deeper in the code:

diff --git a/mods/cnc/maps/nod07b/nod07b.lua b/mods/cnc/maps/nod07b/nod07b.lua
index 593f831c15..e4f0f288e8 100644
--- a/mods/cnc/maps/nod07b/nod07b.lua
+++ b/mods/cnc/maps/nod07b/nod07b.lua
@@ -159,8 +159,8 @@ SendReinforcementsWave = function(team)
                transport.UnloadPassengers()
                Trigger.OnPassengerExited(transport, function(_, passenger)
                        Utils.Do(passengers, function(actor)
-                               if actor.Type == "e6" then 
-                                       CaptureStructures(actor)
+                               if actor.Type == "e6" then
+                                       Trigger.AfterDelay(50, function() CaptureStructures(actor) end)
                                else
                                        IdleHunt(actor)
                                end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment