Add TakeOffOnCreation and TakeOffOnResupply to Aircraft

Before this, it was impossible to replicate the behavior of the original games (staying on pad/airfield after reload) without hacking around in Mods.Common.
This allows modders to disable these without meddling with code.
This commit is contained in:
reaperrr
2017-07-14 05:33:51 +02:00
committed by Matthias Mailänder
parent 5cfb5aaf2d
commit c9ff362ea2
5 changed files with 15 additions and 4 deletions

View File

@@ -78,6 +78,12 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Does this actor cancel its previous activity after resupplying?")]
public readonly bool AbortOnResupply = true;
[Desc("Does this actor automatically take off after resupplying?")]
public readonly bool TakeOffOnResupply = false;
[Desc("Does this actor automatically take off after creation?")]
public readonly bool TakeOffOnCreation = true;
[Desc("Altitude at which the aircraft considers itself landed.")]
public readonly WDist LandAltitude = WDist.Zero;
@@ -264,7 +270,8 @@ namespace OpenRA.Mods.Common.Traits
if (host == null)
return;
self.QueueActivity(new TakeOff(self));
if (Info.TakeOffOnCreation)
self.QueueActivity(new TakeOff(self));
}
// Add land activity if LandOnCondidion resolves to true and the actor can land at the current location.