Allow force-move to disable the harvest activity. Fixes #3459.
This commit is contained in:
@@ -426,14 +426,19 @@ namespace OpenRA.Mods.RA
|
|||||||
|
|
||||||
public bool CanTargetLocation(Actor self, CPos location, List<Actor> actorsAtLocation, TargetModifiers modifiers, ref string cursor)
|
public bool CanTargetLocation(Actor self, CPos location, List<Actor> actorsAtLocation, TargetModifiers modifiers, ref string cursor)
|
||||||
{
|
{
|
||||||
|
if (modifiers.HasModifier(TargetModifiers.ForceMove))
|
||||||
|
return false;
|
||||||
|
|
||||||
// Don't leak info about resources under the shroud
|
// 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<ResourceLayer>().GetResource(location);
|
var res = self.World.WorldActor.Trait<ResourceLayer>().GetResource(location);
|
||||||
var info = self.Info.Traits.Get<HarvesterInfo>();
|
var info = self.Info.Traits.Get<HarvesterInfo>();
|
||||||
|
|
||||||
if (res == null) return false;
|
if (res == null || !info.Resources.Contains(res.info.Name))
|
||||||
if (!info.Resources.Contains(res.info.Name)) return false;
|
return false;
|
||||||
|
|
||||||
cursor = "harvest";
|
cursor = "harvest";
|
||||||
IsQueued = modifiers.HasModifier(TargetModifiers.ForceQueue);
|
IsQueued = modifiers.HasModifier(TargetModifiers.ForceQueue);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user