From 305b70d60956152170135afb1f16210af8b07f44 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sat, 17 May 2025 13:37:31 -0400 Subject: [PATCH] v3.1.0: fixed wandmaker sometimes spawning in doors in new prison entrs --- .../actors/mobs/npcs/Wandmaker.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Wandmaker.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Wandmaker.java index a690e7c94..2937c2924 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Wandmaker.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Wandmaker.java @@ -53,7 +53,7 @@ import com.shatteredpixel.shatteredpixeldungeon.windows.WndWandmaker; import com.watabou.noosa.Game; import com.watabou.utils.Bundle; import com.watabou.utils.Callback; -import com.watabou.utils.Point; +import com.watabou.utils.PathFinder; import com.watabou.utils.Random; import java.util.ArrayList; @@ -305,11 +305,11 @@ public class Wandmaker extends NPC { do { validPos = true; npc.pos = level.pointToCell(room.random((room.width() > 6 && room.height() > 6) ? 2 : 1)); - if (npc.pos == level.entrance()){ + if (npc.pos == level.entrance() || level.solid[npc.pos]){ validPos = false; } - for (Point door : room.connected.values()){ - if (level.trueDistance( npc.pos, level.pointToCell( door ) ) <= 1){ + for (int i : PathFinder.NEIGHBOURS4){ + if (level.map[npc.pos+i] == Terrain.DOOR){ validPos = false; } } @@ -345,7 +345,7 @@ public class Wandmaker extends NPC { public static ArrayList spawnRoom( ArrayList rooms) { questRoomSpawned = false; - if (!spawned && (type != 0 || (Dungeon.depth > 6 && Random.Int( 10 - Dungeon.depth ) == 0))) { + if (!spawned && (type != 0 || (Dungeon.depth == 7))) { // decide between 1,2, or 3 for quest type. if (type == 0) type = Random.Int(3)+1;