From 41dd7ca42816681445a577a323818340f73d1c9f Mon Sep 17 00:00:00 2001 From: reaperrr Date: Fri, 22 Dec 2017 00:02:50 +0100 Subject: [PATCH] Fix NukeLaunch being displayed too early Adding it to ScreenMap from the ctor unconditionally didn't mesh well with potentially being added to world with a delay. --- OpenRA.Mods.Common/Projectiles/NukeLaunch.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/OpenRA.Mods.Common/Projectiles/NukeLaunch.cs b/OpenRA.Mods.Common/Projectiles/NukeLaunch.cs index 8d9ae46eaa..e916038b07 100644 --- a/OpenRA.Mods.Common/Projectiles/NukeLaunch.cs +++ b/OpenRA.Mods.Common/Projectiles/NukeLaunch.cs @@ -37,6 +37,7 @@ namespace OpenRA.Mods.Common.Effects WPos pos; int ticks; + bool isAddedToScreenMap; public NukeLaunch(Player firedBy, string name, WeaponInfo weapon, string weaponPalette, string upSequence, string downSequence, WPos launchPos, WPos targetPos, WDist velocity, int delay, bool skipAscent, string flashType) @@ -64,12 +65,16 @@ namespace OpenRA.Mods.Common.Effects if (skipAscent) ticks = turn; - - firedBy.World.ScreenMap.Add(this, pos, anim.Image); } public void Tick(World world) { + if (!isAddedToScreenMap) + { + world.ScreenMap.Add(this, pos, anim.Image); + isAddedToScreenMap = true; + } + anim.Tick(); if (ticks == turn)