Sync RTB path hash.
This commit is contained in:
@@ -25,10 +25,12 @@ namespace OpenRA.Mods.RA.Air
|
||||
public override object Create( ActorInitializer init ) { return new Plane( init, this ); }
|
||||
}
|
||||
|
||||
public class Plane : Aircraft, IIssueOrder, IResolveOrder, IOrderVoice, ITick, INotifyDamage
|
||||
public class Plane : Aircraft, IIssueOrder, IResolveOrder, IOrderVoice, ITick, INotifyDamage, ISync
|
||||
{
|
||||
public IDisposable reservation;
|
||||
|
||||
[Sync]
|
||||
public int2 RTBPathHash;
|
||||
|
||||
public Plane( ActorInitializer init, PlaneInfo info ) : base( init, info ) { }
|
||||
|
||||
bool firstTick = true;
|
||||
|
||||
@@ -37,11 +37,11 @@ namespace OpenRA.Mods.RA.Air
|
||||
{
|
||||
dest = ChooseAirfield(self);
|
||||
}
|
||||
|
||||
|
||||
var plane = self.Trait<Plane>();
|
||||
var res = dest.TraitOrDefault<Reservable>();
|
||||
if (res != null)
|
||||
{
|
||||
var plane = self.Trait<Plane>();
|
||||
plane.UnReserve();
|
||||
plane.reservation = res.Reserve(self);
|
||||
}
|
||||
@@ -77,6 +77,7 @@ namespace OpenRA.Mods.RA.Air
|
||||
w1 = (c1 + f).ToInt2();
|
||||
w2 = (c2 + f).ToInt2();
|
||||
w3 = (approachStart).ToInt2();
|
||||
plane.RTBPathHash = w1 + w2 + w3;
|
||||
|
||||
isCalculated = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user