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.
This commit is contained in:
@@ -71,9 +71,12 @@ public abstract class PeriodicTaskBasePlugIn<TConfiguration, TState> : IPeriodic
|
|||||||
return;
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user