Skip to content

Commit

Permalink
Fix timing on BasticStationEvents
Browse files Browse the repository at this point in the history
  • Loading branch information
ewokswagger committed Nov 12, 2024
1 parent 84903f6 commit 83267fd
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,15 @@ public override void Update(float frameTime)

if (Resolve(uid, ref nextEventComponent, false)) // If there is a nextEventComponent use the stashed event instead of running it directly.
{
ResetTimer(eventScheduler);
TimeSpan nextEventTime = _timing.CurTime + TimeSpan.FromSeconds(eventScheduler.TimeUntilNextEvent);
if (!_event.TryGenerateRandomEvent(eventScheduler.ScheduledGameRules, out string? generatedEvent, nextEventTime) || generatedEvent == null)
{
ResetTimer(eventScheduler);
continue;
}
// Cycle the stashed event with the new generated event and time.
string storedEvent= _next.UpdateNextEvent(nextEventComponent, generatedEvent, nextEventTime);
if (storedEvent == null || storedEvent == string.Empty) //If there was no stored event don't try to run it.
continue;
GameTicker.AddGameRule(storedEvent);
ResetTimer(eventScheduler);
continue;
}
// DeltaV end events using NextEventComponent
Expand Down

0 comments on commit 83267fd

Please sign in to comment.