Skip to content

Commit

Permalink
Fix crash caused by queuing multiple pick up orders for a single unit.
Browse files Browse the repository at this point in the history
  • Loading branch information
darkademic committed May 25, 2024
1 parent d3d4bdd commit 5115947
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions OpenRA.Mods.Common/Activities/PickupUnit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ public override bool Tick(Actor self)
if (IsCanceling)
return true;

// If already carrying the target (can happen queuing multiple orders to pick up the same target)
if (carryall.State == Carryall.CarryallState.Carrying && cargo == carryall.Carryable && ChildActivity is not TakeOff)
return true;

if (cargo.IsDead || carryable.IsTraitDisabled || !cargo.AppearsFriendlyTo(self) || cargo != carryall.Carryable)
{
Cancel(self, true);
Expand Down

0 comments on commit 5115947

Please sign in to comment.