From efc494b85972f295cede755a50f47d51a99ddf24 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sun, 23 Jun 2013 14:22:37 +1200 Subject: [PATCH] Allow force-move to disable the harvest activity. Fixes #3459. --- OpenRA.Mods.RA/Harvester.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/OpenRA.Mods.RA/Harvester.cs b/OpenRA.Mods.RA/Harvester.cs index 6803329716..7a17785dd2 100644 --- a/OpenRA.Mods.RA/Harvester.cs +++ b/OpenRA.Mods.RA/Harvester.cs @@ -426,14 +426,19 @@ namespace OpenRA.Mods.RA public bool CanTargetLocation(Actor self, CPos location, List actorsAtLocation, TargetModifiers modifiers, ref string cursor) { + if (modifiers.HasModifier(TargetModifiers.ForceMove)) + return false; + // Don't leak info about resources under the shroud - if (!self.Owner.Shroud.IsExplored(location)) return false; + if (!self.Owner.Shroud.IsExplored(location)) + return false; var res = self.World.WorldActor.Trait().GetResource(location); var info = self.Info.Traits.Get(); - if (res == null) return false; - if (!info.Resources.Contains(res.info.Name)) return false; + if (res == null || !info.Resources.Contains(res.info.Name)) + return false; + cursor = "harvest"; IsQueued = modifiers.HasModifier(TargetModifiers.ForceQueue);