Skip to content

Commit

Permalink
Fix Event Manager Allowing to Start Multiple Events of the Same Type …
Browse files Browse the repository at this point in the history
…in a Short Time Window (Simple-Station#645)

# Description
Makes it so that the event scheduler doesn't pick events that were
already added (but not yet ended).

In order to fix this:

<details><p>


![image](https://github.com/user-attachments/assets/fd73dbce-7cbc-489b-8990-7ae791723351)

</p></details>
  • Loading branch information
Mnemotechnician authored Aug 3, 2024
1 parent b5bc583 commit 75b36bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Content.Server/StationEvents/EventManagerSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public TimeSpan TimeSinceLastEvent(EntityPrototype stationEvent)

private bool CanRun(EntityPrototype prototype, StationEventComponent stationEvent, int playerCount, TimeSpan currentTime)
{
if (GameTicker.IsGameRuleActive(prototype.ID))
if (GameTicker.IsGameRuleAdded(prototype.ID))
return false;

if (stationEvent.MaxOccurrences.HasValue && GetOccurrences(prototype) >= stationEvent.MaxOccurrences.Value)
Expand Down

0 comments on commit 75b36bf

Please sign in to comment.