Convert Altitude to world coords.

Removes the obsolete AltitudeInit: use CenterPositionInit instead.
This commit is contained in:
Paul Chote
2013-12-24 11:22:07 +13:00
parent c42a6f8386
commit aa2f865d5d
20 changed files with 61 additions and 86 deletions

View File

@@ -40,8 +40,7 @@ namespace OpenRA.Mods.RA.Air
var helicopter = self.Trait<Helicopter>();
var cruiseAltitude = new WRange(helicopter.Info.CruiseAltitude * 1024 / Game.CellSize);
if (AdjustAltitude(self, helicopter, cruiseAltitude))
if (AdjustAltitude(self, helicopter, helicopter.Info.CruiseAltitude))
return this;
// Rotate towards the target
@@ -53,7 +52,7 @@ namespace OpenRA.Mods.RA.Air
var move = helicopter.FlyStep(desiredFacing);
if (dist.HorizontalLengthSquared < move.HorizontalLengthSquared)
{
helicopter.SetPosition(self, pos + new WVec(0, 0, cruiseAltitude.Range - pos.Z));
helicopter.SetPosition(self, pos + new WVec(0, 0, helicopter.Info.CruiseAltitude.Range - pos.Z));
return NextActivity;
}