Fix aircraft being repaired mid-air
Repairable was originally written for ground actors, so it's both safer and much easier to just handle this in Aircraft directly.
This commit is contained in:
@@ -717,9 +717,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
else
|
||||
self.QueueActivity(order.Queued, new HeliFlyAndLandWhenIdle(self, target, Info));
|
||||
}
|
||||
else if (order.OrderString == "Enter")
|
||||
else if (order.OrderString == "Enter" || order.OrderString == "Repair")
|
||||
{
|
||||
// Enter orders are only valid for own/allied actors,
|
||||
// Enter and Repair orders are only valid for own/allied actors,
|
||||
// which are guaranteed to never be frozen.
|
||||
if (order.Target.Type != TargetType.Actor)
|
||||
return;
|
||||
|
||||
@@ -101,6 +101,10 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (order.Target.Type != TargetType.Actor)
|
||||
return;
|
||||
|
||||
// Aircraft handle Repair orders directly in the Aircraft trait
|
||||
if (self.Info.HasTraitInfo<AircraftInfo>())
|
||||
return;
|
||||
|
||||
if (!CanRepairAt(order.Target.Actor) || (!CanRepair() && !CanRearm()))
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user