Convert non-aircraft positioning to world coords.

This removes the incomplete and unused hover code
on Mobile, which would be more trouble that it is
currently worth to carry over.
This commit is contained in:
Paul Chote
2013-07-21 13:42:25 +12:00
parent 29009fe3a4
commit c3f04cc32e
20 changed files with 67 additions and 96 deletions

View File

@@ -17,14 +17,14 @@ using OpenRA.Traits;
namespace OpenRA.Mods.RA
{
public class CargoInfo : ITraitInfo
public class CargoInfo : ITraitInfo, Requires<IOccupySpaceInfo>
{
public readonly int MaxWeight = 0;
public readonly int PipCount = 0;
public readonly string[] Types = { };
public readonly int UnloadFacing = 0;
public readonly string[] InitialUnits = { };
public readonly int minimalUnloadAltitude = 0;
public readonly WRange MaximumUnloadAltitude = WRange.Zero;
public object Create( ActorInitializer init ) { return new Cargo( init, this ); }
}
@@ -93,7 +93,7 @@ namespace OpenRA.Mods.RA
// Cannot unload mid-air
var ios = self.TraitOrDefault<IOccupySpace>();
if (ios != null && ios.Altitude > info.minimalUnloadAltitude)
if (ios != null && ios.CenterPosition.Z > info.MaximumUnloadAltitude.Range)
return false;
// TODO: Check if there is a free tile to unload to
@@ -106,8 +106,7 @@ namespace OpenRA.Mods.RA
return false;
// Cannot load mid-air
var ios = self.TraitOrDefault<IOccupySpace>();
return ios == null || ios.Altitude == info.minimalUnloadAltitude;
return self.CenterPosition.Z < info.MaximumUnloadAltitude.Range;
}
public string CursorForOrder(Actor self, Order order)