From facf958bae9fd6b092cb17a1fd37820ad83ee9e2 Mon Sep 17 00:00:00 2001 From: ScottNZ Date: Sun, 1 Jul 2012 13:02:23 +1200 Subject: [PATCH] Move towards extraction LZ if einstein isn't in the world. --- OpenRA.Mods.RA/Missions/Allies01Script.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.RA/Missions/Allies01Script.cs b/OpenRA.Mods.RA/Missions/Allies01Script.cs index 073b095010..a1e7d5bcfc 100644 --- a/OpenRA.Mods.RA/Missions/Allies01Script.cs +++ b/OpenRA.Mods.RA/Missions/Allies01Script.cs @@ -179,7 +179,16 @@ namespace OpenRA.Mods.RA.Missions { var spawnActor = self.World.SharedRandom.Next(2) == 0 ? attackEntryPoint1 : attackEntryPoint2; var actor = self.World.CreateActor(unit, new TypeDictionary { new OwnerInit(soviets), new LocationInit(spawnActor.Location) }); - actor.QueueActivity(new AttackMove.AttackMoveActivity(actor, new Attack(Target.FromActor(einstein), 3))); // better way of doing this? + Activity innerActivity; + if (einstein != null && einstein.IsInWorld) + { + innerActivity = new Attack(Target.FromActor(einstein), 3); + } + else + { + innerActivity = new Move.Move(extractionLZ.Location, 3); + } + actor.QueueActivity(new AttackMove.AttackMoveActivity(actor, innerActivity)); } }