Fix dock sequence dock/undock notifications
- move Refinery dock/undock notifications to OnStateDock/-Undock and only call Undock if Dock was also called. - Add INotifyHarvesterAction support to VoxelHarvesterDockSequence.
This commit is contained in:
@@ -31,6 +31,8 @@ namespace OpenRA.Mods.Common.Activities
|
||||
{
|
||||
foreach (var trait in self.TraitsImplementing<INotifyHarvesterAction>())
|
||||
trait.Docked();
|
||||
foreach (var nd in Refinery.TraitsImplementing<INotifyDocking>())
|
||||
nd.Docked(Refinery, self);
|
||||
|
||||
wsb.PlayCustomAnimation(self, wda.DockSequence, () => wsb.PlayCustomAnimationRepeating(self, wda.DockLoopSequence));
|
||||
dockAnimPlayed = true;
|
||||
@@ -53,6 +55,10 @@ namespace OpenRA.Mods.Common.Activities
|
||||
dockingState = DockingState.Complete;
|
||||
foreach (var trait in self.TraitsImplementing<INotifyHarvesterAction>())
|
||||
trait.Undocked();
|
||||
|
||||
if (Refinery.IsInWorld && !Refinery.IsDead)
|
||||
foreach (var nd in Refinery.TraitsImplementing<INotifyDocking>())
|
||||
nd.Undocked(Refinery, self);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user