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))
|
if (IsCanceling || cargo.IsEmpty(self))
|
||||||
return NextActivity;
|
return NextActivity;
|
||||||
|
|
||||||
|
if (!cargo.CanUnload())
|
||||||
|
{
|
||||||
|
Cancel(self, true);
|
||||||
|
return NextActivity;
|
||||||
|
}
|
||||||
|
|
||||||
foreach (var inu in notifiers)
|
foreach (var inu in notifiers)
|
||||||
inu.Unloading(self);
|
inu.Unloading(self);
|
||||||
|
|
||||||
|
|||||||
@@ -185,11 +185,13 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
{
|
{
|
||||||
if (order.OrderString == "Unload")
|
if (order.OrderString == "Unload")
|
||||||
{
|
{
|
||||||
if (!CanUnload())
|
if (!order.Queued && !CanUnload())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Unloading = true;
|
if (!order.Queued)
|
||||||
self.CancelActivity();
|
self.CancelActivity();
|
||||||
|
|
||||||
|
Unloading = true;
|
||||||
if (aircraft != null)
|
if (aircraft != null)
|
||||||
self.QueueActivity(new HeliLand(self, true));
|
self.QueueActivity(new HeliLand(self, true));
|
||||||
self.QueueActivity(new UnloadCargo(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);
|
return Util.AdjacentCells(self.World, Target.FromActor(self)).Where(c => self.Location != c);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CanUnload()
|
public bool CanUnload()
|
||||||
{
|
{
|
||||||
if (checkTerrainType)
|
if (checkTerrainType)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user