diff --git a/OpenRA.Mods.Common/AI/HackyAI.cs b/OpenRA.Mods.Common/AI/HackyAI.cs index c02bcf87cb..3498861f90 100644 --- a/OpenRA.Mods.Common/AI/HackyAI.cs +++ b/OpenRA.Mods.Common/AI/HackyAI.cs @@ -833,6 +833,10 @@ namespace OpenRA.Mods.Common.AI continue; } + var para = harvester.TraitOrDefault(); + if (para != null && para.IsInAir) + continue; + // Tell the idle harvester to quit slacking: var newSafeResourcePatch = FindNextResource(harvester, harv); BotDebug("AI: Harvester {0} is idle. Ordering to {1} in search for new resources.".F(harvester, newSafeResourcePatch)); diff --git a/OpenRA.Mods.Common/Traits/Parachutable.cs b/OpenRA.Mods.Common/Traits/Parachutable.cs index 7416ae7d4f..f326736f06 100644 --- a/OpenRA.Mods.Common/Traits/Parachutable.cs +++ b/OpenRA.Mods.Common/Traits/Parachutable.cs @@ -59,6 +59,8 @@ namespace OpenRA.Mods.Common.Traits positionable = self.Trait(); } + public bool IsInAir { get; private set; } + void INotifyCreated.Created(Actor self) { conditionManager = self.TraitOrDefault(); @@ -66,12 +68,16 @@ namespace OpenRA.Mods.Common.Traits void INotifyParachute.OnParachute(Actor self) { + IsInAir = true; + if (conditionManager != null && parachutingToken == ConditionManager.InvalidConditionToken && !string.IsNullOrEmpty(info.ParachutingCondition)) parachutingToken = conditionManager.GrantCondition(self, info.ParachutingCondition); } void INotifyParachute.OnLanded(Actor self, Actor ignore) { + IsInAir = false; + if (parachutingToken != ConditionManager.InvalidConditionToken) parachutingToken = conditionManager.RevokeCondition(self, parachutingToken);