Make Harvester conditional.
This commit is contained in:
committed by
abcdefg30
parent
cd90c70cdf
commit
dcb70d12e3
@@ -43,6 +43,9 @@ namespace OpenRA.Mods.Common.Activities
|
||||
|
||||
public override bool Tick(Actor self)
|
||||
{
|
||||
if (harv.IsTraitDisabled)
|
||||
Cancel(self, true);
|
||||
|
||||
if (IsCanceling)
|
||||
return true;
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
|
||||
public override bool Tick(Actor self)
|
||||
{
|
||||
if (IsCanceling)
|
||||
if (IsCanceling || harv.IsTraitDisabled)
|
||||
return true;
|
||||
|
||||
if (NextActivity != null)
|
||||
|
||||
@@ -53,6 +53,9 @@ namespace OpenRA.Mods.Common.Activities
|
||||
|
||||
public override bool Tick(Actor self)
|
||||
{
|
||||
if (harv.IsTraitDisabled)
|
||||
Cancel(self, true);
|
||||
|
||||
if (IsCanceling || harv.IsFull)
|
||||
return true;
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
return false;
|
||||
|
||||
case DockingState.Drag:
|
||||
if (IsCanceling || !Refinery.IsInWorld || Refinery.IsDead)
|
||||
if (IsCanceling || !Refinery.IsInWorld || Refinery.IsDead || Harv.IsTraitDisabled)
|
||||
return true;
|
||||
|
||||
dockingState = DockingState.Dock;
|
||||
@@ -69,7 +69,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
return false;
|
||||
|
||||
case DockingState.Dock:
|
||||
if (!IsCanceling && Refinery.IsInWorld && !Refinery.IsDead)
|
||||
if (!IsCanceling && Refinery.IsInWorld && !Refinery.IsDead && !Harv.IsTraitDisabled)
|
||||
OnStateDock(self);
|
||||
else
|
||||
dockingState = DockingState.Undock;
|
||||
@@ -77,7 +77,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
return false;
|
||||
|
||||
case DockingState.Loop:
|
||||
if (IsCanceling || !Refinery.IsInWorld || Refinery.IsDead || Harv.TickUnload(self, Refinery))
|
||||
if (IsCanceling || !Refinery.IsInWorld || Refinery.IsDead || Harv.IsTraitDisabled || Harv.TickUnload(self, Refinery))
|
||||
dockingState = DockingState.Undock;
|
||||
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user