Fix aircraft failing to reload
This commit is contained in:
@@ -134,11 +134,15 @@ namespace OpenRA.Mods.Common.Activities
|
|||||||
if (source == AttackSource.AttackMove)
|
if (source == AttackSource.AttackMove)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// AbortOnResupply cancels the current activity (after resupplying) plus any queued activities
|
|
||||||
if (attackAircraft.Info.AbortOnResupply)
|
if (attackAircraft.Info.AbortOnResupply)
|
||||||
|
{
|
||||||
|
// AbortOnResupply cancels the current activity (after resupplying) plus any queued activities
|
||||||
NextActivity?.Cancel(self);
|
NextActivity?.Cancel(self);
|
||||||
|
Queue(new ReturnToBase(self));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
QueueChild(new ReturnToBase(self));
|
||||||
|
|
||||||
QueueChild(new ReturnToBase(self));
|
|
||||||
returnToBase = true;
|
returnToBase = true;
|
||||||
return attackAircraft.Info.AbortOnResupply;
|
return attackAircraft.Info.AbortOnResupply;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -373,12 +373,9 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
if (source == AttackSource.AttackMove)
|
if (source == AttackSource.AttackMove)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// AbortOnResupply cancels the current activity (after resupplying) plus any queued activities
|
Activity rearmActivity = null;
|
||||||
if (attack.Info.AbortOnResupply)
|
|
||||||
NextActivity?.Cancel(self);
|
|
||||||
|
|
||||||
if (isAircraft)
|
if (isAircraft)
|
||||||
QueueChild(new ReturnToBase(self));
|
rearmActivity = new ReturnToBase(self);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var target = self.World.ActorsHavingTrait<Reservable>()
|
var target = self.World.ActorsHavingTrait<Reservable>()
|
||||||
@@ -390,9 +387,21 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
.FirstOrDefault();
|
.FirstOrDefault();
|
||||||
|
|
||||||
if (target != null)
|
if (target != null)
|
||||||
QueueChild(new Resupply(self, target, new WDist(512)));
|
rearmActivity = new Resupply(self, target, new WDist(512));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (rearmActivity == null)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
if (attack.Info.AbortOnResupply)
|
||||||
|
{
|
||||||
|
// AbortOnResupply cancels the current activity (after resupplying) plus any queued activities
|
||||||
|
NextActivity?.Cancel(self);
|
||||||
|
Queue(rearmActivity);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
QueueChild(rearmActivity);
|
||||||
|
|
||||||
returnToBase = true;
|
returnToBase = true;
|
||||||
return attack.Info.AbortOnResupply;
|
return attack.Info.AbortOnResupply;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user