From de369be7cae7722c88ac9db40df136201baf1ca8 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sun, 21 Aug 2022 13:32:25 -0400 Subject: [PATCH] v1.4.0: adjusted daily seeds to be out of the user-enterable range --- .../com/shatteredpixel/shatteredpixeldungeon/Dungeon.java | 5 +++-- .../com/shatteredpixel/shatteredpixeldungeon/Rankings.java | 7 ++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java index 556334cf0..41a12e1d8 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java @@ -197,10 +197,11 @@ public class Dungeon { mobsToChampion = -1; if (daily) { - seed = SPDSettings.lastDaily(); + //Ensures that daily seeds are not in the range of user-enterable seeds + seed = SPDSettings.lastDaily() + DungeonSeed.TOTAL_SEEDS; DateFormat format = DateFormat.getDateInstance(DateFormat.SHORT, Locale.ROOT); format.setTimeZone(TimeZone.getTimeZone("UTC")); - customSeedText = format.format(new Date(seed)); + customSeedText = format.format(new Date(SPDSettings.lastDaily())); } else if (!SPDSettings.customSeed().isEmpty()){ customSeedText = SPDSettings.customSeed(); seed = DungeonSeed.convertFromText(customSeedText); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Rankings.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Rankings.java index 6d5fb9164..3f1cdb0f4 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Rankings.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Rankings.java @@ -37,6 +37,7 @@ import com.shatteredpixel.shatteredpixeldungeon.journal.Notes; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.ui.QuickSlotButton; import com.shatteredpixel.shatteredpixeldungeon.ui.Toolbar; +import com.shatteredpixel.shatteredpixeldungeon.utils.DungeonSeed; import com.watabou.noosa.Game; import com.watabou.utils.Bundlable; import com.watabou.utils.Bundle; @@ -99,7 +100,11 @@ public enum Rankings { if (rec.daily){ latestDaily = rec; - dailyScoreHistory.put(Dungeon.seed, rec.score); + if (Dungeon.seed <= DungeonSeed.TOTAL_SEEDS) { + dailyScoreHistory.put(Dungeon.seed, rec.score); + } else { + dailyScoreHistory.put(Dungeon.seed - DungeonSeed.TOTAL_SEEDS, rec.score); + } save(); return; }