public override bool Tick(Actor self) { if (IsCanceling || garrison.IsEmpty(self)) { return(true); } if (garrison.CanUnload()) { foreach (var inu in notifiers) { inu.Unloading(self); } var actor = garrison.Peek(self); var spawn = self.CenterPosition; var exitSubCell = ChooseExitSubCell(actor); if (exitSubCell == null) { self.NotifyBlocker(BlockedExitCells(actor)); Queue(new Wait(10)); return(false); } garrison.Unload(self); self.World.AddFrameEndTask(w => { if (actor.Disposed) { return; } var move = actor.Trait <IMove>(); var pos = actor.Trait <IPositionable>(); pos.SetPosition(actor, exitSubCell.Value.Cell, exitSubCell.Value.SubCell); pos.SetVisualPosition(actor, spawn); actor.CancelActivity(); w.Add(actor); }); } if (!unloadAll || !garrison.CanUnload()) { if (garrison.Info.AfterUnloadDelay > 0) { QueueChild(new Wait(garrison.Info.AfterUnloadDelay, false)); } if (takeOffAfterUnload) { QueueChild(new TakeOff(self)); } return(true); } return(false); }