closes #3091 Have Helis take off after repair/rearm

This commit is contained in:
Jordan Glue
2014-05-04 19:10:37 +10:00
parent 26ae11c155
commit ea32390700
5 changed files with 52 additions and 3 deletions

View File

@@ -9,6 +9,7 @@
#endregion
using System;
using OpenRA.Mods.RA.Air;
using OpenRA.Mods.RA.Render;
using OpenRA.Traits;
@@ -30,7 +31,13 @@ namespace OpenRA.Mods.RA.Activities
health = self.TraitOrDefault<Health>();
if (health == null) return NextActivity;
if (health.DamageState == DamageState.Undamaged)
{
var helicopter = self.TraitOrDefault<Helicopter>();
if (helicopter != null)
return helicopter.TakeOff(host);
return NextActivity;
}
if (remainingTicks == 0)
{
@@ -44,6 +51,7 @@ namespace OpenRA.Mods.RA.Activities
remainingTicks = 1;
return this;
}
self.InflictDamage(self, -hpToRepair, null);
if (host != null)