0
0
mirror of https://github.com/sp-tarkov/server.git synced 2025-02-12 15:50:42 -05:00

Reset existing event data when caching currently active seasonal events

This commit is contained in:
Chomp 2024-12-24 19:13:02 +00:00
parent 952544f5d3
commit 5a15aa348d

View File

@ -240,6 +240,12 @@ export class SeasonalEventService {
const currentDate = new Date();
const seasonalEvents = this.getEventDetails();
// reset existing data
this.currentlyActiveEvents = [];
this.christmasEventActive = false;
this.halloweenEventActive = false;
// Add active events to array
for (const event of seasonalEvents) {
const eventStartDate = new Date(currentDate.getFullYear(), event.startMonth - 1, event.startDay);
const eventEndDate = new Date(currentDate.getFullYear(), event.endMonth - 1, event.endDay);