Prevent transport from moving while loading cargo

This commit is contained in:
atlimit8
2014-10-02 14:24:18 -05:00
parent 3f6e1a608a
commit b9ac4da32a

View File

@@ -29,7 +29,7 @@ namespace OpenRA.Mods.RA
public object Create(ActorInitializer init) { return new Cargo(init, this); }
}
public class Cargo : IPips, IIssueOrder, IResolveOrder, IOrderVoice, INotifyKilled, INotifyCapture, ITick, INotifySold
public class Cargo : IPips, IIssueOrder, IResolveOrder, IOrderVoice, INotifyKilled, INotifyCapture, ITick, INotifySold, IDisableMove
{
public readonly CargoInfo Info;
readonly Actor self;
@@ -155,6 +155,7 @@ namespace OpenRA.Mods.RA
return self.HasVoice("Unload") ? "Unload" : "Move";
}
public bool MoveDisabled(Actor self) { return reserves.Any(); }
public bool HasSpace(int weight) { return totalWeight + reservedWeight + weight <= Info.MaxWeight; }
public bool IsEmpty(Actor self) { return cargo.Count == 0; }