From cebc0b66a590c5465114e3023caed672755abd63 Mon Sep 17 00:00:00 2001 From: Scott_NZ Date: Mon, 20 Aug 2012 15:13:08 +1200 Subject: [PATCH] Make the Viewport code easier to follow --- OpenRA.Mods.RA/Missions/Allies02Script.cs | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/OpenRA.Mods.RA/Missions/Allies02Script.cs b/OpenRA.Mods.RA/Missions/Allies02Script.cs index 2fc2879eea..719ee18a66 100644 --- a/OpenRA.Mods.RA/Missions/Allies02Script.cs +++ b/OpenRA.Mods.RA/Missions/Allies02Script.cs @@ -421,11 +421,19 @@ namespace OpenRA.Mods.RA.Missions sovietWarFactory = actors["SovietWarFactory"]; sovietRallyPoint = actors["SovietRallyPoint"]; flamersEntryPoint = actors["FlamersEntryPoint"]; - w.WorldActor.Trait().Explore(w, sam1.Location, 2); - w.WorldActor.Trait().Explore(w, sam2.Location, 2); - w.WorldActor.Trait().Explore(w, sam3.Location, 2); - w.WorldActor.Trait().Explore(w, sam4.Location, 2); - Game.MoveViewport(((w.LocalPlayer ?? allies1) == allies1 ? chinookHusk.Location : allies2BasePoint.Location).ToFloat2()); + var shroud = w.WorldActor.Trait(); + shroud.Explore(w, sam1.Location, 2); + shroud.Explore(w, sam2.Location, 2); + shroud.Explore(w, sam3.Location, 2); + shroud.Explore(w, sam4.Location, 2); + if (w.LocalPlayer == null || w.LocalPlayer == allies1) + { + Game.MoveViewport(chinookHusk.Location.ToFloat2()); + } + else + { + Game.MoveViewport(allies2BasePoint.Location.ToFloat2()); + } Game.ConnectionStateChanged += StopMusic; }