Fix resupply anim not always finishing properly
This commit is contained in:
@@ -75,14 +75,15 @@ namespace OpenRA.Mods.Common.Activities
|
|||||||
|
|
||||||
public override Activity Tick(Actor self)
|
public override Activity Tick(Actor self)
|
||||||
{
|
{
|
||||||
if (IsCanceling)
|
if (IsCanceling || host.Type == TargetType.Invalid
|
||||||
return NextActivity;
|
|| (closeEnough.LengthSquared > 0 && !host.IsInRange(self.CenterPosition, closeEnough)))
|
||||||
|
{
|
||||||
|
// This is necessary to ensure host resupply actions (like animations) finish properly
|
||||||
|
foreach (var notifyResupply in notifyResupplies)
|
||||||
|
notifyResupply.ResupplyTick(host.Actor, self, ResupplyType.None);
|
||||||
|
|
||||||
if (host.Type == TargetType.Invalid)
|
|
||||||
return NextActivity;
|
|
||||||
|
|
||||||
if (closeEnough.LengthSquared > 0 && !host.IsInRange(self.CenterPosition, closeEnough))
|
|
||||||
return NextActivity;
|
return NextActivity;
|
||||||
|
}
|
||||||
|
|
||||||
if (activeResupplyTypes.HasFlag(ResupplyType.Repair))
|
if (activeResupplyTypes.HasFlag(ResupplyType.Repair))
|
||||||
RepairTick(self);
|
RepairTick(self);
|
||||||
|
|||||||
Reference in New Issue
Block a user