Correct parameter order in IOrderTargeter.CanTargetLocation interface definition

This commit is contained in:
Paul Chote
2011-05-30 19:22:01 +12:00
parent 922f4754f9
commit b425d770c5
2 changed files with 7 additions and 4 deletions

View File

@@ -90,12 +90,15 @@ namespace OpenRA.Orders
.OrderByDescending( x => x.Order.OrderPriority ) ) .OrderByDescending( x => x.Order.OrderPriority ) )
{ {
var actorsAt = self.World.ActorMap.GetUnitsAt( xy ).ToList(); var actorsAt = self.World.ActorMap.GetUnitsAt( xy ).ToList();
var forceAttack = mi.Modifiers.HasModifier(Modifiers.Ctrl);
var forceMove = mi.Modifiers.HasModifier(Modifiers.Alt);
var forceQueue = mi.Modifiers.HasModifier(Modifiers.Shift);
string cursor = null; string cursor = null;
if( underCursor != null ) if( underCursor != null )
if (o.Order.CanTargetActor(self, underCursor, mi.Modifiers.HasModifier(Modifiers.Ctrl), mi.Modifiers.HasModifier(Modifiers.Alt), mi.Modifiers.HasModifier(Modifiers.Shift), ref cursor)) if (o.Order.CanTargetActor(self, underCursor, forceAttack, forceMove, forceQueue, ref cursor))
return new UnitOrderResult( self, o.Order, o.Trait, cursor, Target.FromActor( underCursor ) ); return new UnitOrderResult( self, o.Order, o.Trait, cursor, Target.FromActor( underCursor ) );
if (o.Order.CanTargetLocation(self, xy, actorsAt, mi.Modifiers.HasModifier(Modifiers.Ctrl), mi.Modifiers.HasModifier(Modifiers.Alt), mi.Modifiers.HasModifier(Modifiers.Shift), ref cursor)) if (o.Order.CanTargetLocation(self, xy, actorsAt, forceAttack, forceMove, forceQueue, ref cursor))
return new UnitOrderResult( self, o.Order, o.Trait, cursor, Target.FromCell( xy ) ); return new UnitOrderResult( self, o.Order, o.Trait, cursor, Target.FromCell( xy ) );
} }
} }

View File

@@ -46,7 +46,7 @@ namespace OpenRA.Traits
string OrderID { get; } string OrderID { get; }
int OrderPriority { get; } int OrderPriority { get; }
bool CanTargetActor(Actor self, Actor target, bool forceAttack, bool forceMove, bool forceQueue, ref string cursor); bool CanTargetActor(Actor self, Actor target, bool forceAttack, bool forceMove, bool forceQueue, ref string cursor);
bool CanTargetLocation(Actor self, int2 location, List<Actor> actorsAtLocation, bool forceAttack, bool forceQueue, bool forceMove, ref string cursor); bool CanTargetLocation(Actor self, int2 location, List<Actor> actorsAtLocation, bool forceAttack, bool forceMove, bool forceQueue, ref string cursor);
bool IsQueued { get; } bool IsQueued { get; }
} }