Adds a reoccurrence delay to station events (#8359)
* Adds a reoccurence delay to station events * typo * total minutes * Update Content.Server/StationEvents/Events/StationEvent.cs * Update Content.Server/StationEvents/Events/StationEvent.cs * reset Co-authored-by: ike709 <ike709@github.com>
This commit is contained in:
@@ -352,6 +352,12 @@ namespace Content.Server.StationEvents
|
||||
return false;
|
||||
}
|
||||
|
||||
if (stationEvent.LastRun != TimeSpan.Zero && currentTime.TotalMinutes <
|
||||
stationEvent.ReoccurrenceDelay + stationEvent.LastRun.TotalMinutes)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -372,6 +378,7 @@ namespace Content.Server.StationEvents
|
||||
foreach (var stationEvent in _stationEvents)
|
||||
{
|
||||
stationEvent.Occurrences = 0;
|
||||
stationEvent.LastRun = TimeSpan.Zero;
|
||||
}
|
||||
|
||||
_timeUntilNextEvent = MinimumTimeUntilFirstEvent;
|
||||
|
||||
Reference in New Issue
Block a user