Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
CDVoidwalker committed Mar 10, 2019
1 parent 45ab547 commit e16a4bc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions OpenRA.Mods.Common/Traits/Cargo.cs
Expand Up @@ -271,9 +271,9 @@ public string VoicePhraseForOrder(Actor self, Order order)

public Actor Peek() { return cargo.Last(); }

public Actor Unload(Actor self)
public Actor Unload(Actor self, Actor target)
{
var a = cargo.Last();
var a = cargo.First(x => x == target);
cargo.Remove(a);

totalWeight -= GetWeight(a);
Expand All @@ -299,6 +299,11 @@ public Actor Unload(Actor self)
return a;
}

public Actor Unload(Actor self)
{
return Unload(self, cargo.Last());
}

void SetPassengerFacing(Actor passenger)
{
if (facing.Value == null)
Expand Down
2 changes: 1 addition & 1 deletion OpenRA.Mods.Common/Traits/Passenger.cs
Expand Up @@ -190,7 +190,7 @@ void INotifyKilled.Killed(Actor self, AttackInfo e)
return;

Cargo c = Transport.Trait<Cargo>();
c.Unload(self);
c.Unload(Transport, self);
}
}
}

0 comments on commit e16a4bc

Please sign in to comment.