From 851d115a4456eac0fdd6ce5853a4e8647cebf145 Mon Sep 17 00:00:00 2001 From: abcdefg30 Date: Sun, 28 Jul 2019 13:04:58 +0200 Subject: [PATCH] Fix allies05a crashing by ensuring the cameras exist before removing them --- mods/ra/maps/allies-05a/allies05a.lua | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/mods/ra/maps/allies-05a/allies05a.lua b/mods/ra/maps/allies-05a/allies05a.lua index 31f5a42608..2eafed6e62 100644 --- a/mods/ra/maps/allies-05a/allies05a.lua +++ b/mods/ra/maps/allies-05a/allies05a.lua @@ -202,7 +202,7 @@ FreeTanya = function() Media.PlaySpeechNotification(greece, "TargetFreed") end - if not SpecialCameras then + if not SpecialCameras and PrisonCamera and PrisonCamera.IsInWorld then PrisonCamera.Destroy() end end @@ -244,6 +244,15 @@ InitTriggers = function() Media.DisplayMessage("Good work! But next time skip the heroics!", "Battlefield Control") greece.MarkCompletedObjective(infWarfactory) end + + if not PrisonCamera then + if SpecialCameras then + PrisonCamera = Actor.Create("camera", true, { Owner = greece, Location = TrukWaypoint5.Location }) + else + PrisonCamera = Actor.Create("camera.small", true, { Owner = greece, Location = Prison.Location + CVec.New(1, 1) }) + end + end + Trigger.ClearAll(Spy) Trigger.AfterDelay(DateTime.Seconds(2), MissInfiltrated) end) @@ -319,7 +328,7 @@ InitTriggers = function() greece.MarkCompletedObjective(mainObj) SendReinforcements() - if SpecialCameras then + if PrisonCamera and PrisonCamera.IsInWorld then PrisonCamera.Destroy() end end)