Skip to content
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

BindActorTriggers for APC passengers #16963

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions mods/ra/maps/desert-shellmap/desert-shellmap.lua
Expand Up @@ -65,6 +65,19 @@ BindActorTriggers = function(a)
Trigger.OnDamaged(a, function()
if a.HasPassengers then
a.Stop()

-- HACK: UnloadPassengers does not return the unloaded passengers, but we need to bind the triggers
local actors = { }
while a.HasPassengers do
local unit = a.UnloadPassenger()
BindActorTriggers(unit)
actors[#actors + 1] = unit
end

Utils.Do(actors, function(unit)
a.LoadPassenger(unit)
end)

a.UnloadPassengers()
end
end)
Expand Down