From 2fbea092bc783037595ea2b8996966ab319b8815 Mon Sep 17 00:00:00 2001 From: Oliver Brakmann Date: Tue, 12 Apr 2016 21:17:04 +0200 Subject: [PATCH] Fix submarines not being attackable when surfaced This will also fix the issue of all pre-placed subs playing the submerging sound during the start of a map. --- OpenRA.Mods.Common/Traits/Cloak.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OpenRA.Mods.Common/Traits/Cloak.cs b/OpenRA.Mods.Common/Traits/Cloak.cs index 9f2bac1920..0a92925b8b 100644 --- a/OpenRA.Mods.Common/Traits/Cloak.cs +++ b/OpenRA.Mods.Common/Traits/Cloak.cs @@ -84,7 +84,10 @@ namespace OpenRA.Mods.Common.Traits // The upgrade manager exists, but may not have finished being created yet. // We'll defer the upgrades until the end of the tick, at which point it will be ready. if (Cloaked) + { + wasCloaked = true; self.World.AddFrameEndTask(_ => GrantUpgrades(self)); + } } public bool Cloaked { get { return !IsTraitDisabled && remainingTime <= 0; } }