Fix potentially bogus usages of OnAllRemovedFromWorld

This commit is contained in:
abcdefg30
2019-09-07 23:41:01 +02:00
committed by reaperrr
parent 31918e8712
commit aee9ee6187
4 changed files with 11 additions and 12 deletions

View File

@@ -189,8 +189,8 @@ InitTriggers = function()
end
end)
end)
Trigger.OnAllRemovedFromWorld(FirstUSSRBase, function()
if baseCamera then
Trigger.OnAllKilledOrCaptured(FirstUSSRBase, function()
if baseCamera and baseCamera.IsInWorld then
baseCamera.Destroy()
end
end)

View File

@@ -252,8 +252,8 @@ InitTriggers = function()
AlertFirstBase()
end)
end)
Trigger.OnAllRemovedFromWorld(FirstUSSRBase, function()
if baseCamera then
Trigger.OnAllKilledOrCaptured(FirstUSSRBase, function()
if baseCamera and baseCamera.IsInWorld then
baseCamera.Destroy()
end
end)

View File

@@ -217,6 +217,6 @@ WorldLoaded = function()
Trigger.AfterDelay(ActivateAIDelay, ActivateAI)
Trigger.AfterDelay(StartTimerDelay, StartTimerFunction)
Trigger.OnAllRemovedFromWorld(DestroySubPensTriggerActivator, DestroySubPensCompleted)
Trigger.OnAllKilledOrCaptured(DestroySubPensTriggerActivator, DestroySubPensCompleted)
Trigger.OnAllRemovedFromWorld(ClearSubActivityTriggerActivator, ClearSubActivityCompleted)
end

View File

@@ -286,8 +286,7 @@ SovietBaseMaintenanceSetup = function()
and a.HasProperty("StartBuildingRepairs") and a.HasProperty("Sell")
end)
-- This includes killed, captured (actor is temporarily removed) and sold.
Trigger.OnAllRemovedFromWorld(sovietbuildings, function()
Trigger.OnAllKilledOrCaptured(sovietbuildings, function()
Utils.Do(humans, function(player)
player.MarkCompletedObjective(destroyBase)
end)