Override selection if the mouse is over an already selected actor.
This commit is contained in:
@@ -1182,6 +1182,10 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
|
|
||||||
public bool TargetOverridesSelection(Actor self, Target target, List<Actor> actorsAt, CPos xy, TargetModifiers modifiers)
|
public bool TargetOverridesSelection(Actor self, Target target, List<Actor> actorsAt, CPos xy, TargetModifiers modifiers)
|
||||||
{
|
{
|
||||||
|
// Always prioritise orders over selecting other peoples actors or own actors that are already selected
|
||||||
|
if (target.Type == TargetType.Actor && (target.Actor.Owner != self.Owner || self.World.Selection.Contains(target.Actor)))
|
||||||
|
return true;
|
||||||
|
|
||||||
return modifiers.HasModifier(TargetModifiers.ForceMove);
|
return modifiers.HasModifier(TargetModifiers.ForceMove);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -160,6 +160,10 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
|
|
||||||
public bool TargetOverridesSelection(Actor self, Target target, List<Actor> actorsAt, CPos xy, TargetModifiers modifiers)
|
public bool TargetOverridesSelection(Actor self, Target target, List<Actor> actorsAt, CPos xy, TargetModifiers modifiers)
|
||||||
{
|
{
|
||||||
|
// Always prioritise orders over selecting other peoples actors or own actors that are already selected
|
||||||
|
if (target.Type == TargetType.Actor && (target.Actor.Owner != self.Owner || self.World.Selection.Contains(target.Actor)))
|
||||||
|
return true;
|
||||||
|
|
||||||
return modifiers.HasModifier(TargetModifiers.ForceMove);
|
return modifiers.HasModifier(TargetModifiers.ForceMove);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -160,6 +160,10 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
readonly bool rejectMove;
|
readonly bool rejectMove;
|
||||||
public bool TargetOverridesSelection(Actor self, Target target, List<Actor> actorsAt, CPos xy, TargetModifiers modifiers)
|
public bool TargetOverridesSelection(Actor self, Target target, List<Actor> actorsAt, CPos xy, TargetModifiers modifiers)
|
||||||
{
|
{
|
||||||
|
// Always prioritise orders over selecting other peoples actors or own actors that are already selected
|
||||||
|
if (target.Type == TargetType.Actor && (target.Actor.Owner != self.Owner || self.World.Selection.Contains(target.Actor)))
|
||||||
|
return true;
|
||||||
|
|
||||||
return modifiers.HasModifier(TargetModifiers.ForceMove);
|
return modifiers.HasModifier(TargetModifiers.ForceMove);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -958,6 +958,10 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
readonly bool rejectMove;
|
readonly bool rejectMove;
|
||||||
public bool TargetOverridesSelection(Actor self, Target target, List<Actor> actorsAt, CPos xy, TargetModifiers modifiers)
|
public bool TargetOverridesSelection(Actor self, Target target, List<Actor> actorsAt, CPos xy, TargetModifiers modifiers)
|
||||||
{
|
{
|
||||||
|
// Always prioritise orders over selecting other peoples actors or own actors that are already selected
|
||||||
|
if (target.Type == TargetType.Actor && (target.Actor.Owner != self.Owner || self.World.Selection.Contains(target.Actor)))
|
||||||
|
return true;
|
||||||
|
|
||||||
return modifiers.HasModifier(TargetModifiers.ForceMove);
|
return modifiers.HasModifier(TargetModifiers.ForceMove);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user