mirror of
https://github.com/sp-tarkov/server.git
synced 2025-02-13 09:50:43 -05:00
Updated cacheActiveEvents()
to treat eventEndDate as inclusive
Moved enabled check to be earlier
This commit is contained in:
parent
c46d97a65a
commit
1e486c867b
@ -247,14 +247,15 @@ export class SeasonalEventService {
|
||||
|
||||
// Add active events to array
|
||||
for (const event of seasonalEvents) {
|
||||
if (!event.enabled) {
|
||||
continue;
|
||||
}
|
||||
|
||||
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, 23, 59);
|
||||
|
||||
// Current date is between start/end dates
|
||||
if (currentDate >= eventStartDate && currentDate <= eventEndDate) {
|
||||
if (!event.enabled) {
|
||||
continue;
|
||||
}
|
||||
this.currentlyActiveEvents.push(event);
|
||||
|
||||
if (SeasonalEventType[event.type] === SeasonalEventType.CHRISTMAS) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user