Skip to content

Commit

Permalink
Aeon M2 - check if transport is dead (#411)
Browse files Browse the repository at this point in the history
* Aeon M2 - check if transport is dead

A lua script error can arise if a transport is killed e.g. at the end of mission 2, as the code doesn't check if it is dead before trying to assign to a platoon.
  • Loading branch information
maudlin27 committed Jul 28, 2023
1 parent 96fbb66 commit 09f1fb3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion SCCA_Coop_A02/SCCA_Coop_A02_script.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1289,7 +1289,9 @@ function TransportAssault(platoon, landingLocation, patrolChain, airUnits)
end
else
for _, v in transports do
aiBrain:AssignUnitsToPlatoon('TransportPool', {v}, 'Scout', 'None')
if not(v.Dead) then
aiBrain:AssignUnitsToPlatoon('TransportPool', {v}, 'Scout', 'None')
end
end
end
end
Expand Down

0 comments on commit 09f1fb3

Please sign in to comment.