From 5adc90a76ef5a3b4a2e70a00b6b1c88849f593e1 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sun, 17 Apr 2011 19:35:49 +1200 Subject: [PATCH] Fix map-placed SAM sites --- OpenRA.Mods.Cnc/AttackPopupTurreted.cs | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/OpenRA.Mods.Cnc/AttackPopupTurreted.cs b/OpenRA.Mods.Cnc/AttackPopupTurreted.cs index 0f4f0a91ad..467c864fb3 100644 --- a/OpenRA.Mods.Cnc/AttackPopupTurreted.cs +++ b/OpenRA.Mods.Cnc/AttackPopupTurreted.cs @@ -50,13 +50,7 @@ namespace OpenRA.Mods.Cnc Info = info; Turret = init.self.Trait(); if (init.Contains()) - { - State = PopupState.Closed; - init.self.Trait() - .PlayCustomAnimRepeating(init.self, "closed-idle"); - Turret.desiredFacing = null; buildComplete = true; - } } protected override bool CanAttack( Actor self, Target target ) @@ -130,7 +124,18 @@ namespace OpenRA.Mods.Cnc } bool buildComplete = false; - public void BuildingComplete(Actor self) { buildComplete = true; } + public void BuildingComplete(Actor self) + { + // Set true for SkipMakeAnimsInit + if (buildComplete) + { + State = PopupState.Closed; + self.Trait() + .PlayCustomAnimRepeating(self, "closed-idle"); + Turret.desiredFacing = null; + } + buildComplete = true; + } public float GetDamageModifier(Actor attacker, WarheadInfo warhead) {