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:
ike709
2022-05-22 20:01:54 -05:00
committed by GitHub
parent b129844579
commit 7a3087609a
2 changed files with 19 additions and 0 deletions

View File

@@ -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;