From 5cc8734dc27ad515c59ae2590743ff58f7e865c3 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Mon, 16 May 2022 22:37:03 -0400 Subject: [PATCH] v1.3.0: fixed exploits that let DM-300 dig outside of its arena --- .../shatteredpixeldungeon/actors/mobs/DM300.java | 5 ++++- .../shatteredpixeldungeon/levels/CavesBossLevel.java | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DM300.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DM300.java index 0a15bb31f..4c4500673 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DM300.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DM300.java @@ -579,9 +579,12 @@ public class DM300 extends Mob { for (int i : PathFinder.NEIGHBOURS9){ if (Dungeon.level.map[pos+i] == Terrain.WALL || Dungeon.level.map[pos+i] == Terrain.WALL_DECO){ Point p = Dungeon.level.cellToPoint(pos+i); - if (p.y < gate.bottom && p.x > gate.left-2 && p.x < gate.right+2){ + if (p.y < gate.bottom && p.x >= gate.left-2 && p.x < gate.right+2){ continue; //don't break the gate or walls around the gate } + if (!CavesBossLevel.diggableArea.inside(p)){ + continue; //Don't break any walls out of the boss arena + } Level.set(pos+i, Terrain.EMPTY_DECO); GameScene.updateMap(pos+i); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CavesBossLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CavesBossLevel.java index b636499a2..05dc210a2 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CavesBossLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CavesBossLevel.java @@ -101,6 +101,7 @@ public class CavesBossLevel extends Level { private static int WIDTH = 33; private static int HEIGHT = 42; + public static Rect diggableArea = new Rect(2, 11, 31, 40); public static Rect mainArena = new Rect(5, 14, 28, 37); public static Rect gate = new Rect(14, 13, 19, 14); public static int[] pylonPositions = new int[]{ 4 + 13*WIDTH, 28 + 13*WIDTH, 4 + 37*WIDTH, 28 + 37*WIDTH };