mirror of
https://github.com/sp-tarkov/server.git
synced 2025-02-12 16:10:43 -05:00
Reset existing event data when caching currently active seasonal events
This commit is contained in:
parent
952544f5d3
commit
5a15aa348d
@ -240,6 +240,12 @@ export class SeasonalEventService {
|
|||||||
const currentDate = new Date();
|
const currentDate = new Date();
|
||||||
const seasonalEvents = this.getEventDetails();
|
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) {
|
for (const event of seasonalEvents) {
|
||||||
const eventStartDate = new Date(currentDate.getFullYear(), event.startMonth - 1, event.startDay);
|
const eventStartDate = new Date(currentDate.getFullYear(), event.startMonth - 1, event.startDay);
|
||||||
const eventEndDate = new Date(currentDate.getFullYear(), event.endMonth - 1, event.endDay);
|
const eventEndDate = new Date(currentDate.getFullYear(), event.endMonth - 1, event.endDay);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user