lots of heli fixes
This commit is contained in:
@@ -31,8 +31,12 @@ namespace OpenRa.Game.Traits.Activities
|
||||
}
|
||||
|
||||
var dist = Dest - self.CenterLocation;
|
||||
if (float2.WithinEpsilon(float2.Zero, dist, 10))
|
||||
if (float2.WithinEpsilon(float2.Zero, dist, 2))
|
||||
{
|
||||
self.CenterLocation = Dest;
|
||||
self.Location = ((1 / 24f) * self.CenterLocation).ToInt2();
|
||||
return NextActivity;
|
||||
}
|
||||
|
||||
var desiredFacing = Util.GetFacing(dist, unit.Facing);
|
||||
Util.TickFacing(ref unit.Facing, desiredFacing, self.Info.ROT);
|
||||
|
||||
@@ -16,18 +16,12 @@ namespace OpenRa.Game.Traits.Activities
|
||||
float2 w1, w2, w3; /* tangent points to turn circles */
|
||||
float2 landPoint;
|
||||
|
||||
static bool IsReserved(Actor a)
|
||||
{
|
||||
var res = a.traits.GetOrDefault<Reservable>();
|
||||
return res != null && res.IsReserved;
|
||||
}
|
||||
|
||||
Actor ChooseAirfield(Actor self)
|
||||
{
|
||||
var airfield = Game.world.Actors
|
||||
.Where(a => a.Info == Rules.UnitInfo["AFLD"] /* todo: generalize this */
|
||||
&& a.Owner == self.Owner
|
||||
&& !IsReserved(a))
|
||||
&& !Reservable.IsReserved(a))
|
||||
.FirstOrDefault();
|
||||
|
||||
if (airfield == null)
|
||||
|
||||
Reference in New Issue
Block a user