From b9ac4da32a8ada1c0f688ee273bec6938e87bed7 Mon Sep 17 00:00:00 2001 From: atlimit8 Date: Thu, 2 Oct 2014 14:24:18 -0500 Subject: [PATCH] Prevent transport from moving while loading cargo --- OpenRA.Mods.RA/Cargo.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.RA/Cargo.cs b/OpenRA.Mods.RA/Cargo.cs index 0a2db520a6..967c8350ca 100644 --- a/OpenRA.Mods.RA/Cargo.cs +++ b/OpenRA.Mods.RA/Cargo.cs @@ -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; }