From 0b5fcdad870b20c810631fb1269ab945ef07c89c Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Mon, 2 Feb 2026 17:11:27 -0500 Subject: [PATCH] v3.3.5: gardens now properly set embers to grass, and account for fire --- .../actors/blobs/Foliage.java | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/Foliage.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/Foliage.java index 469edc2b9..06250cf5f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/Foliage.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/Foliage.java @@ -28,9 +28,11 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.effects.BlobEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShaftParticle; import com.shatteredpixel.shatteredpixeldungeon.journal.Notes; +import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; +import com.watabou.utils.PathFinder; public class Foliage extends Blob { @@ -46,6 +48,8 @@ public class Foliage extends Blob { boolean seen = false; + Fire fire = (Fire)Dungeon.level.blobs.get( Fire.class ); + int cell; for (int i = area.left; i < area.right; i++) { for (int j = area.top; j < area.bottom; j++) { @@ -56,8 +60,19 @@ public class Foliage extends Blob { volume += off[cell]; if (map[cell] == Terrain.EMBERS) { - map[cell] = Terrain.GRASS; - GameScene.updateMap(cell); + //only turn terrain into grass if no fire is adjacent to it + boolean valid = true; + if (fire != null && fire.volume > 0) { + for (int k : PathFinder.NEIGHBOURS9) { + if (fire.cur[cell + k] > 0){ + valid = false; + } + } + } + if (valid) { + Level.set(cell, Terrain.GRASS); + GameScene.updateMap(cell); + } } seen = seen || Dungeon.level.visited[cell];