From 9de10a0e96f6ed9864db5ab7ca0710e1b2e1a895 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Mon, 29 Jan 2024 16:56:06 -0500 Subject: [PATCH] v2.3.2: fixed cases where terrain features wouldn't appear --- .../shatteredpixeldungeon/tiles/TerrainFeaturesTilemap.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/TerrainFeaturesTilemap.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/TerrainFeaturesTilemap.java index d36c42c0f..5c023af46 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/TerrainFeaturesTilemap.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/TerrainFeaturesTilemap.java @@ -66,6 +66,7 @@ public class TerrainFeaturesTilemap extends DungeonTilemap { int stage = (Dungeon.depth-1)/5; if (Dungeon.depth == 21 && Dungeon.level instanceof LastShopLevel) stage--; + stage = Math.min(stage, 4); if (tile == Terrain.HIGH_GRASS){ return 9 + 16*stage + (DungeonTileSheet.tileVariance[pos] >= 50 ? 1 : 0); } else if (tile == Terrain.FURROWED_GRASS){ @@ -73,7 +74,7 @@ public class TerrainFeaturesTilemap extends DungeonTilemap { } else if (tile == Terrain.GRASS) { return 13 + 16*stage + (DungeonTileSheet.tileVariance[pos] >= 50 ? 1 : 0); } else if (tile == Terrain.EMBERS) { - return 9 * (16*5) + (DungeonTileSheet.tileVariance[pos] >= 50 ? 1 : 0); + return 9 + (16*5) + (DungeonTileSheet.tileVariance[pos] >= 50 ? 1 : 0); } return -1;