add the takeoff and landing sound

This commit is contained in:
Matthias Mailänder
2015-07-25 20:08:38 +02:00
parent 9c67e46226
commit 25ee5f7287
4 changed files with 25 additions and 3 deletions

View File

@@ -21,6 +21,7 @@ namespace OpenRA.Mods.Common.Activities
readonly Target target;
readonly WDist maxRange;
readonly WDist minRange;
bool playedSound;
public HeliFly(Actor self, Target t)
{
@@ -53,6 +54,12 @@ namespace OpenRA.Mods.Common.Activities
if (IsCanceled || !target.IsValidFor(self))
return NextActivity;
if (!playedSound && helicopter.Info.TakeoffSound != null && self.IsAtGroundLevel())
{
Sound.Play(helicopter.Info.TakeoffSound);
playedSound = true;
}
if (AdjustAltitude(self, helicopter, helicopter.Info.CruiseAltitude))
return this;