From bd5cda12ddf9985990fbb5c1a5c74bb3427b7ae3 Mon Sep 17 00:00:00 2001 From: Acentech Dev Date: Tue, 21 Jul 2026 15:02:45 +0300 Subject: [PATCH] fix(minigame): GM ForceStart bypasses the previous-run TaskDuration guard A forced start (e.g. /starths) was blocked for the whole TaskDuration after a run even though the event had already ended, so re-starting needed a server restart. ForceStart now skips the 'previous event still running' guard; scheduled auto-starts still respect it. --- .../PlugIns/PeriodicTasks/PeriodicTaskBasePlugIn.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/GameLogic/PlugIns/PeriodicTasks/PeriodicTaskBasePlugIn.cs b/src/GameLogic/PlugIns/PeriodicTasks/PeriodicTaskBasePlugIn.cs index a29eaae..07883a5 100644 --- a/src/GameLogic/PlugIns/PeriodicTasks/PeriodicTaskBasePlugIn.cs +++ b/src/GameLogic/PlugIns/PeriodicTasks/PeriodicTaskBasePlugIn.cs @@ -71,9 +71,12 @@ public abstract class PeriodicTaskBasePlugIn : IPeriodic return; } - if (this.IsPreviousEventStillRunning(state)) + // A GM ForceStart (e.g. /starths) bypasses the "previous run still within its TaskDuration" + // guard: the previous event has actually ended, and the admin explicitly wants a new one now. + // (Without this, TaskDuration keeps the state blocked for its full length even after the event + // finished, so a re-start only worked after a server restart.) Scheduled auto-starts still respect it. + if (!this._isStartForced && this.IsPreviousEventStillRunning(state)) { - this._isStartForced = false; return; }