Merge pull request #12511 from abcdefg30/onAllMTMsRemoved
Fix a potential crash in Monster Tank Madness
This commit is contained in:
@@ -65,8 +65,12 @@ SetupAlliedBase = function()
|
||||
DefendOutpost = player.AddSecondaryObjective("Defend and repair our outpost.")
|
||||
player.MarkCompletedObjective(FindOutpost)
|
||||
|
||||
Trigger.AfterDelay(DateTime.Seconds(1), function() -- don't fail the Objective instantly
|
||||
Trigger.OnAllRemovedFromWorld(alliedOutpost, function() player.MarkFailedObjective(DefendOutpost) end)
|
||||
-- Don't fail the Objective instantly
|
||||
Trigger.AfterDelay(DateTime.Seconds(1), function()
|
||||
|
||||
-- The actor might have been destroyed/crushed in this one second delay
|
||||
local actors = Utils.Where(alliedOutpost, function(actor) return actor.IsInWorld end)
|
||||
Trigger.OnAllRemovedFromWorld(actors, function() player.MarkFailedObjective(DefendOutpost) end)
|
||||
end)
|
||||
|
||||
Trigger.AfterDelay(DateTime.Minutes(1) + DateTime.Seconds(40), function()
|
||||
|
||||
Reference in New Issue
Block a user