diff --git a/src/RealTime/Events/RealTimeEventManager.cs b/src/RealTime/Events/RealTimeEventManager.cs index 7b4e2262..7d79e585 100644 --- a/src/RealTime/Events/RealTimeEventManager.cs +++ b/src/RealTime/Events/RealTimeEventManager.cs @@ -211,7 +211,7 @@ public ICityEvent GetCityEvent(ushort buildingId) /// public void ProcessEvents() { - if (RemoveCanceledEvents()) + if (RemoveOldAndCanceledEvents()) { OnEventsChanged(); } @@ -469,17 +469,23 @@ private bool SynchronizeWithVanillaEvent(ushort eventId) return true; } - private bool RemoveCanceledEvents() + private bool RemoveOldAndCanceledEvents() { + bool eventsChanged = false; for (int i = finishedEvents.Count - 1; i >= 0; --i) { - if (MustCancelEvent(finishedEvents[i])) + var finishedEvent = finishedEvents[i]; + var isOldEvent = finishedEvent.EndTime.Day != timeInfo.Now.Day; + if (isOldEvent || MustCancelEvent(finishedEvent)) { finishedEvents.RemoveAt(i); + if (!isOldEvent) + { + eventsChanged = true; + } } } - bool eventsChanged = false; for (int i = activeEvents.Count - 1; i >= 0; --i) { if (MustCancelEvent(activeEvents[i]))