make cargo unload deploy action queueable
fix line spacing remove unnecessary null check
This commit is contained in:
@@ -59,6 +59,12 @@ namespace OpenRA.Mods.Common.Activities
|
||||
if (IsCanceling || cargo.IsEmpty(self))
|
||||
return NextActivity;
|
||||
|
||||
if (!cargo.CanUnload())
|
||||
{
|
||||
Cancel(self, true);
|
||||
return NextActivity;
|
||||
}
|
||||
|
||||
foreach (var inu in notifiers)
|
||||
inu.Unloading(self);
|
||||
|
||||
|
||||
@@ -185,11 +185,13 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
if (order.OrderString == "Unload")
|
||||
{
|
||||
if (!CanUnload())
|
||||
if (!order.Queued && !CanUnload())
|
||||
return;
|
||||
|
||||
if (!order.Queued)
|
||||
self.CancelActivity();
|
||||
|
||||
Unloading = true;
|
||||
self.CancelActivity();
|
||||
if (aircraft != null)
|
||||
self.QueueActivity(new HeliLand(self, true));
|
||||
self.QueueActivity(new UnloadCargo(self, true));
|
||||
@@ -201,7 +203,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
return Util.AdjacentCells(self.World, Target.FromActor(self)).Where(c => self.Location != c);
|
||||
}
|
||||
|
||||
bool CanUnload()
|
||||
public bool CanUnload()
|
||||
{
|
||||
if (checkTerrainType)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user