From b5d69ec3b6fcd0b9855ea2ea922d1400ceaac5a8 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Fri, 15 Dec 2023 13:40:32 -0500 Subject: [PATCH] v2.3.0: fixed current holiday not actually being cached --- .../shatteredpixeldungeon/utils/Holiday.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/utils/Holiday.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/utils/Holiday.java index 3092af428..26f669d32 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/utils/Holiday.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/utils/Holiday.java @@ -53,14 +53,14 @@ public enum Holiday { } public static Holiday getCurrentHoliday(){ - return getHolidayForDate((GregorianCalendar) GregorianCalendar.getInstance()); + if (cached == null){ + cached = getHolidayForDate((GregorianCalendar) GregorianCalendar.getInstance()); + } + return cached; } //requires a gregorian calendar public static Holiday getHolidayForDate(GregorianCalendar cal){ - if (cached != null){ - return cached; - } //legacy holiday logic from late 2016 to early 2024 //only halloween and winter holidays, and they had longer dates determined by week of month