diff --git a/OpenRA.Mods.RA/Move/Move.cs b/OpenRA.Mods.RA/Move/Move.cs index 097e1ab51f..5e5cec526b 100755 --- a/OpenRA.Mods.RA/Move/Move.cs +++ b/OpenRA.Mods.RA/Move/Move.cs @@ -58,11 +58,18 @@ namespace OpenRA.Mods.RA.Move this.ignoreBuilding = ignoreBuilding; } + static readonly List NoPath = new List(); public Move(Target target, int range) { - this.getPath = (self,mobile) => self.World.WorldActor.Trait().FindUnitPathToRange( - mobile.toCell, target.CenterPosition.ToCPos(), - range, self); + this.getPath = (self, mobile) => + { + if (!target.IsValid) + return NoPath; + + return self.World.WorldActor.Trait().FindUnitPathToRange( + mobile.toCell, target.CenterPosition.ToCPos(), range, self); + }; + this.destination = null; this.nearEnough = range; }