diff --git a/OpenRA.Mods.Common/Effects/Bullet.cs b/OpenRA.Mods.Common/Effects/Bullet.cs index f7b6e7b269..49c98d8588 100644 --- a/OpenRA.Mods.Common/Effects/Bullet.cs +++ b/OpenRA.Mods.Common/Effects/Bullet.cs @@ -182,7 +182,7 @@ namespace OpenRA.Mods.Common.Effects if (!string.IsNullOrEmpty(info.Trail) && --smokeTicks < 0) { var delayedPos = WPos.LerpQuadratic(args.Source, target, angle, ticks - info.TrailDelay, length); - world.AddFrameEndTask(w => w.Add(new Smoke(w, delayedPos, () => GetEffectiveFacing(), info.Trail, trailPalette, info.TrailSequences.Random(world.SharedRandom)))); + world.AddFrameEndTask(w => w.Add(new Smoke(w, delayedPos, GetEffectiveFacing(), info.Trail, trailPalette, info.TrailSequences.Random(world.SharedRandom)))); smokeTicks = info.TrailInterval; } diff --git a/OpenRA.Mods.Common/Effects/Missile.cs b/OpenRA.Mods.Common/Effects/Missile.cs index 2fe5fed611..f1131f00ad 100644 --- a/OpenRA.Mods.Common/Effects/Missile.cs +++ b/OpenRA.Mods.Common/Effects/Missile.cs @@ -805,7 +805,7 @@ namespace OpenRA.Mods.Common.Effects // Create the smoke trail effect if (!string.IsNullOrEmpty(info.TrailImage) && --ticksToNextSmoke < 0 && (state != States.Freefall || info.TrailWhenDeactivated)) { - world.AddFrameEndTask(w => w.Add(new Smoke(w, pos - 3 * move / 2, () => renderFacing, info.TrailImage, trailPalette, info.TrailSequence))); + world.AddFrameEndTask(w => w.Add(new Smoke(w, pos - 3 * move / 2, renderFacing, info.TrailImage, trailPalette, info.TrailSequence))); ticksToNextSmoke = info.TrailInterval; } diff --git a/OpenRA.Mods.Common/Effects/Smoke.cs b/OpenRA.Mods.Common/Effects/Smoke.cs index 3a64d4369a..e3b4068873 100644 --- a/OpenRA.Mods.Common/Effects/Smoke.cs +++ b/OpenRA.Mods.Common/Effects/Smoke.cs @@ -24,15 +24,15 @@ namespace OpenRA.Mods.Common.Effects readonly string palette; public Smoke(World world, WPos pos, string trail, string palette, string sequence) - : this(world, pos, () => 0, trail, palette, sequence) { } + : this(world, pos, 0, trail, palette, sequence) { } - public Smoke(World world, WPos pos, Func facingFunc, string trail, string palette, string sequence) + public Smoke(World world, WPos pos, int facing, string trail, string palette, string sequence) { this.world = world; this.pos = pos; this.palette = palette; - anim = new Animation(world, trail, facingFunc); + anim = new Animation(world, trail, () => facing); anim.PlayThen(sequence, () => world.AddFrameEndTask(w => w.Remove(this))); } diff --git a/OpenRA.Mods.Common/Traits/SmokeTrailWhenDamaged.cs b/OpenRA.Mods.Common/Traits/SmokeTrailWhenDamaged.cs index f0ccfd86f2..d820f553f1 100644 --- a/OpenRA.Mods.Common/Traits/SmokeTrailWhenDamaged.cs +++ b/OpenRA.Mods.Common/Traits/SmokeTrailWhenDamaged.cs @@ -32,7 +32,7 @@ namespace OpenRA.Mods.Common.Traits { readonly SmokeTrailWhenDamagedInfo info; readonly BodyOrientation body; - readonly Func getFacing; + readonly int getFacing; int ticks; public SmokeTrailWhenDamaged(Actor self, SmokeTrailWhenDamagedInfo info) @@ -42,9 +42,9 @@ namespace OpenRA.Mods.Common.Traits var facing = self.TraitOrDefault(); if (facing != null) - getFacing = () => facing.Facing; + getFacing = facing.Facing; else - getFacing = () => 0; + getFacing = 0; } public void Tick(Actor self)