moving Actor.Location onto the appropriate traits (bob)

This commit is contained in:
Chris Forbes
2010-06-19 14:37:06 +12:00
parent db465e1fdd
commit 66adbee2a6
25 changed files with 218 additions and 103 deletions

View File

@@ -68,9 +68,10 @@ namespace OpenRA.Mods.RA.Activities
var unit = self.traits.Get<Unit>();
var speed = .2f * Util.GetEffectiveSpeed(self, UnitMovementType.Fly);
var angle = unit.Facing / 128f * Math.PI;
var aircraft = self.traits.Get<Aircraft>();
self.CenterLocation += speed * -float2.FromAngle((float)angle);
self.Location = ((1 / 24f) * self.CenterLocation).ToInt2();
aircraft.Location = ((1 / 24f) * self.CenterLocation).ToInt2();
unit.Altitude += Math.Sign(desiredAltitude - unit.Altitude);
}