New types for cell and pixel coordinate position/vectors.
This commit is contained in:
@@ -23,12 +23,12 @@ namespace OpenRA.Mods.RA
|
||||
|
||||
public class RallyPoint : IIssueOrder, IResolveOrder, ISync
|
||||
{
|
||||
[Sync] public int2 rallyPoint;
|
||||
[Sync] public CPos rallyPoint;
|
||||
|
||||
public RallyPoint(Actor self)
|
||||
{
|
||||
var info = self.Info.Traits.Get<RallyPointInfo>();
|
||||
rallyPoint = self.Location + new int2(info.RallyPoint[0], info.RallyPoint[1]);
|
||||
rallyPoint = self.Location + new CVec(info.RallyPoint[0], info.RallyPoint[1]);
|
||||
self.World.AddFrameEndTask(w => w.Add(new Effects.RallyPoint(self)));
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace OpenRA.Mods.RA
|
||||
public Order IssueOrder( Actor self, IOrderTargeter order, Target target, bool queued )
|
||||
{
|
||||
if( order.OrderID == "SetRallyPoint" )
|
||||
return new Order(order.OrderID, self, false) { TargetLocation = Traits.Util.CellContaining(target.CenterLocation) };
|
||||
return new Order(order.OrderID, self, false) { TargetLocation = target.CenterLocation.ToCPos() };
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -61,7 +61,7 @@ namespace OpenRA.Mods.RA
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool CanTargetLocation(Actor self, int2 location, List<Actor> actorsAtLocation, bool forceAttack, bool forceQueued, ref string cursor)
|
||||
public bool CanTargetLocation(Actor self, CPos location, List<Actor> actorsAtLocation, bool forceAttack, bool forceQueued, ref string cursor)
|
||||
{
|
||||
if (self.World.Map.IsInMap(location))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user