Replace CPos.CenterPosition -> Map.CenterOfCell.

This commit is contained in:
Paul Chote
2013-09-17 22:27:19 +12:00
parent b6d1d26eeb
commit 7b52fa52b6
48 changed files with 105 additions and 90 deletions

View File

@@ -41,7 +41,7 @@ namespace OpenRA.Mods.RA.Buildings
public Actor FindBaseProvider(World world, Player p, CPos topLeft)
{
var center = topLeft.CenterPosition + FootprintUtils.CenterOffset(this);
var center = world.Map.CenterOfCell(topLeft) + FootprintUtils.CenterOffset(this);
foreach (var bp in world.ActorsWithTrait<BaseProvider>())
{
var validOwner = bp.Actor.Owner == p || (world.LobbyInfo.GlobalSettings.AllyBuildRadius && bp.Actor.Owner.Stances[p] == Stance.Ally);
@@ -137,7 +137,7 @@ namespace OpenRA.Mods.RA.Buildings
occupiedCells = FootprintUtils.UnpathableTiles( self.Info.Name, Info, TopLeft )
.Select(c => Pair.New(c, SubCell.FullCell)).ToArray();
CenterPosition = topLeft.CenterPosition + FootprintUtils.CenterOffset(Info);
CenterPosition = init.world.Map.CenterOfCell(topLeft) + FootprintUtils.CenterOffset(Info);
BuildComplete = init.Contains<SkipMakeAnimsInit>();
}