From c8a517713d25fb3e8b1bd827cf2778b78c7ef423 Mon Sep 17 00:00:00 2001 From: Oliver Brakmann Date: Wed, 11 Nov 2015 21:48:36 +0100 Subject: [PATCH] Fix reinforcements appearing in soviet04a/b despite killed radar dome --- .../soviet04a-reinforcements_teams.lua | 44 +++++++++++-------- .../soviet04b-reinforcements_teams.lua | 44 +++++++++++-------- 2 files changed, 52 insertions(+), 36 deletions(-) diff --git a/mods/ra/maps/soviet-04a/soviet04a-reinforcements_teams.lua b/mods/ra/maps/soviet-04a/soviet04a-reinforcements_teams.lua index 0e50f24842..f549fc2a30 100644 --- a/mods/ra/maps/soviet-04a/soviet04a-reinforcements_teams.lua +++ b/mods/ra/maps/soviet-04a/soviet04a-reinforcements_teams.lua @@ -31,6 +31,10 @@ AttackPaths = } ReinfInf = function() + if Radar.IsDead or Radar.Owner ~= Greece then + return + end + Reinforcements.Reinforce(Greece, InfantryReinfGreece, InfReinfPath, 0, function(soldier) soldier.Hunt() end) @@ -46,35 +50,39 @@ ReinfArmor = function() end BringPatrol1 = function() + if Radar.IsDead or Radar.Owner ~= Greece then + return + end + local units = Reinforcements.Reinforce(Greece, Patrol1Group, { SWRoadPoint.Location }, 0) Utils.Do(units, function(patrols) patrols.Patrol(Patrol1Path, true, 250) end) - if not Radar.IsDead and Radar.Owner == Greece then - Trigger.OnAllKilled(units, function() - if Map.Difficulty == "Hard" then - Trigger.AfterDelay(DateTime.Minutes(4), BringPatrol1) - else - Trigger.AfterDelay(DateTime.Minutes(7), BringPatrol1) - end - end) - end + Trigger.OnAllKilled(units, function() + if Map.Difficulty == "Hard" then + Trigger.AfterDelay(DateTime.Minutes(4), BringPatrol1) + else + Trigger.AfterDelay(DateTime.Minutes(7), BringPatrol1) + end + end) end BringPatrol2 = function() + if Radar.IsDead or Radar.Owner ~= Greece then + return + end + local units = Reinforcements.Reinforce(Greece, Patrol2Group, { NRoadPoint.Location }, 0) Utils.Do(units, function(patrols) patrols.Patrol(Patrol2Path, true, 250) end) - if not Radar.IsDead and Radar.Owner == Greece then - Trigger.OnAllKilled(units, function() - if Map.Difficulty == "Hard" then - Trigger.AfterDelay(DateTime.Minutes(4), BringPatrol2) - else - Trigger.AfterDelay(DateTime.Minutes(7), BringPatrol2) - end - end) - end + Trigger.OnAllKilled(units, function() + if Map.Difficulty == "Hard" then + Trigger.AfterDelay(DateTime.Minutes(4), BringPatrol2) + else + Trigger.AfterDelay(DateTime.Minutes(7), BringPatrol2) + end + end) end diff --git a/mods/ra/maps/soviet-04b/soviet04b-reinforcements_teams.lua b/mods/ra/maps/soviet-04b/soviet04b-reinforcements_teams.lua index c88a0f7353..462a4519a6 100644 --- a/mods/ra/maps/soviet-04b/soviet04b-reinforcements_teams.lua +++ b/mods/ra/maps/soviet-04b/soviet04b-reinforcements_teams.lua @@ -31,6 +31,10 @@ AttackPaths = } ReinfInf = function() + if Radar.IsDead or Radar.Owner ~= Greece then + return + end + Reinforcements.Reinforce(Greece, InfantryReinfGreece, InfReinfPath, 0, function(soldier) soldier.Hunt() end) @@ -46,35 +50,39 @@ ReinfArmor = function() end BringPatrol1 = function() + if Radar.IsDead or Radar.Owner ~= Greece then + return + end + local units = Reinforcements.Reinforce(Greece, Patrol1Group, { NRoadPoint.Location }, 0) Utils.Do(units, function(patrols) patrols.Patrol(Patrol1Path, true, 250) end) - if not Radar.IsDead and Radar.Owner == Greece then - Trigger.OnAllKilled(units, function() - if Map.Difficulty == "Hard" then - Trigger.AfterDelay(DateTime.Minutes(4), BringPatrol1) - else - Trigger.AfterDelay(DateTime.Minutes(7), BringPatrol1) - end - end) - end + Trigger.OnAllKilled(units, function() + if Map.Difficulty == "Hard" then + Trigger.AfterDelay(DateTime.Minutes(4), BringPatrol1) + else + Trigger.AfterDelay(DateTime.Minutes(7), BringPatrol1) + end + end) end BringPatrol2 = function() + if Radar.IsDead or Radar.Owner ~= Greece then + return + end + local units = Reinforcements.Reinforce(Greece, Patrol2Group, { NRoadPoint.Location }, 0) Utils.Do(units, function(patrols) patrols.Patrol(Patrol2Path, true, 250) end) - if not Radar.IsDead and Radar.Owner == Greece then - Trigger.OnAllKilled(units, function() - if Map.Difficulty == "Hard" then - Trigger.AfterDelay(DateTime.Minutes(4), BringPatrol2) - else - Trigger.AfterDelay(DateTime.Minutes(7), BringPatrol2) - end - end) - end + Trigger.OnAllKilled(units, function() + if Map.Difficulty == "Hard" then + Trigger.AfterDelay(DateTime.Minutes(4), BringPatrol2) + else + Trigger.AfterDelay(DateTime.Minutes(7), BringPatrol2) + end + end) end