Undock harvesters when refinery is destroyed or not in world
fixes #2029
This commit is contained in:
@@ -56,7 +56,7 @@ namespace OpenRA.Mods.Cnc
|
|||||||
state = State.Wait;
|
state = State.Wait;
|
||||||
return this;
|
return this;
|
||||||
case State.Loop:
|
case State.Loop:
|
||||||
if (harv.TickUnload(self, proc))
|
if (!proc.IsInWorld || proc.IsDead() || harv.TickUnload(self, proc))
|
||||||
state = State.Undock;
|
state = State.Undock;
|
||||||
return this;
|
return this;
|
||||||
case State.Undock:
|
case State.Undock:
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ namespace OpenRA.Mods.RA
|
|||||||
state = State.Wait;
|
state = State.Wait;
|
||||||
return this;
|
return this;
|
||||||
case State.Loop:
|
case State.Loop:
|
||||||
if (harv.TickUnload(self, proc))
|
if (!proc.IsInWorld || proc.IsDead() || harv.TickUnload(self, proc))
|
||||||
state = State.Undock;
|
state = State.Undock;
|
||||||
return this;
|
return this;
|
||||||
case State.Undock:
|
case State.Undock:
|
||||||
|
|||||||
@@ -212,9 +212,6 @@ namespace OpenRA.Mods.RA
|
|||||||
// Returns true when unloading is complete
|
// Returns true when unloading is complete
|
||||||
public bool TickUnload(Actor self, Actor proc)
|
public bool TickUnload(Actor self, Actor proc)
|
||||||
{
|
{
|
||||||
if (!proc.IsInWorld)
|
|
||||||
return false; // fail to deliver if there is no proc.
|
|
||||||
|
|
||||||
// Wait until the next bale is ready
|
// Wait until the next bale is ready
|
||||||
if (--currentUnloadTicks > 0)
|
if (--currentUnloadTicks > 0)
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user