Check proc's health before (un)docking. Fixes #5338
This commit is contained in:
@@ -54,6 +54,7 @@ namespace OpenRA.Mods.Cnc
|
||||
case State.Dock:
|
||||
ru.PlayCustomAnimation(self, "dock", () => {
|
||||
ru.PlayCustomAnimRepeating(self, "dock-loop");
|
||||
if (proc.IsInWorld && !proc.IsDead())
|
||||
foreach (var nd in proc.TraitsImplementing<INotifyDocking>())
|
||||
nd.Docked(proc, self);
|
||||
state = State.Loop;
|
||||
@@ -66,6 +67,7 @@ namespace OpenRA.Mods.Cnc
|
||||
return this;
|
||||
case State.Undock:
|
||||
ru.PlayCustomAnimBackwards(self, "dock", () => state = State.DragOut);
|
||||
if (proc.IsInWorld && !proc.IsDead())
|
||||
foreach (var nd in proc.TraitsImplementing<INotifyDocking>())
|
||||
nd.Undocked(proc, self);
|
||||
state = State.Wait;
|
||||
|
||||
@@ -47,6 +47,7 @@ namespace OpenRA.Mods.RA
|
||||
case State.Dock:
|
||||
ru.PlayCustomAnimation(self, "dock", () => {
|
||||
ru.PlayCustomAnimRepeating(self, "dock-loop");
|
||||
if (proc.IsInWorld && !proc.IsDead())
|
||||
foreach (var nd in proc.TraitsImplementing<INotifyDocking>())
|
||||
nd.Docked(proc, self);
|
||||
state = State.Loop;
|
||||
@@ -64,6 +65,7 @@ namespace OpenRA.Mods.RA
|
||||
case State.Complete:
|
||||
harv.LastLinkedProc = harv.LinkedProc;
|
||||
harv.LinkProc(self, null);
|
||||
if (proc.IsInWorld && !proc.IsDead())
|
||||
foreach (var nd in proc.TraitsImplementing<INotifyDocking>())
|
||||
nd.Undocked(proc, self);
|
||||
return NextActivity;
|
||||
|
||||
Reference in New Issue
Block a user