Replace WPos.ToCPos -> Map.CellContaining.

This commit is contained in:
Paul Chote
2013-09-17 22:57:30 +12:00
parent 4bc09692e0
commit 9487f49cd5
43 changed files with 81 additions and 83 deletions

6
OpenRA.Mods.RA/Air/Aircraft.cs Executable file → Normal file
View File

@@ -45,7 +45,7 @@ namespace OpenRA.Mods.RA.Air
[Sync] public int Facing { get; set; }
[Sync] public WPos CenterPosition { get; private set; }
public CPos TopLeft { get { return CenterPosition.ToCPos(); } }
public CPos TopLeft { get { return self.World.Map.CellContaining(CenterPosition); } }
public IDisposable Reservation;
public int ROT { get { return info.ROT; } }
@@ -201,7 +201,7 @@ namespace OpenRA.Mods.RA.Air
return new Order(order.OrderID, self, queued) { TargetActor = target.Actor };
if (order.OrderID == "Move")
return new Order(order.OrderID, self, queued) { TargetLocation = target.CenterPosition.ToCPos() };
return new Order(order.OrderID, self, queued) { TargetLocation = self.World.Map.CellContaining(target.CenterPosition) };
return null;
}
@@ -246,7 +246,7 @@ namespace OpenRA.Mods.RA.Air
return false;
IsQueued = modifiers.HasModifier(TargetModifiers.ForceQueue);
cursor = self.World.Map.Contains(target.CenterPosition.ToCPos()) ? "move" : "move-blocked";
cursor = self.World.Map.Contains(self.World.Map.CellContaining(target.CenterPosition)) ? "move" : "move-blocked";
return true;
}

View File

@@ -32,7 +32,7 @@ namespace OpenRA.Mods.RA.Air
var rp = hasHost ? host.TraitOrDefault<RallyPoint>() : null;
var destination = rp != null ? rp.rallyPoint :
(hasHost ? host.CenterPosition.ToCPos() : self.CenterPosition.ToCPos());
(hasHost ? self.World.Map.CellContaining(host.CenterPosition) : self.Location);
return new AttackMove.AttackMoveActivity(self, self.Trait<IMove>().MoveTo(destination, 1));
}