Check proc's health before (un)docking. Fixes #5338
This commit is contained in:
@@ -54,8 +54,9 @@ namespace OpenRA.Mods.Cnc
|
||||
case State.Dock:
|
||||
ru.PlayCustomAnimation(self, "dock", () => {
|
||||
ru.PlayCustomAnimRepeating(self, "dock-loop");
|
||||
foreach (var nd in proc.TraitsImplementing<INotifyDocking>())
|
||||
nd.Docked(proc, self);
|
||||
if (proc.IsInWorld && !proc.IsDead())
|
||||
foreach (var nd in proc.TraitsImplementing<INotifyDocking>())
|
||||
nd.Docked(proc, self);
|
||||
state = State.Loop;
|
||||
});
|
||||
state = State.Wait;
|
||||
@@ -66,8 +67,9 @@ namespace OpenRA.Mods.Cnc
|
||||
return this;
|
||||
case State.Undock:
|
||||
ru.PlayCustomAnimBackwards(self, "dock", () => state = State.DragOut);
|
||||
foreach (var nd in proc.TraitsImplementing<INotifyDocking>())
|
||||
nd.Undocked(proc, self);
|
||||
if (proc.IsInWorld && !proc.IsDead())
|
||||
foreach (var nd in proc.TraitsImplementing<INotifyDocking>())
|
||||
nd.Undocked(proc, self);
|
||||
state = State.Wait;
|
||||
return this;
|
||||
case State.DragOut:
|
||||
@@ -87,4 +89,4 @@ namespace OpenRA.Mods.Cnc
|
||||
yield return Target.FromActor(proc);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user