v1.3.0: fixed exploits that let DM-300 dig outside of its arena
This commit is contained in:
@@ -579,9 +579,12 @@ public class DM300 extends Mob {
|
|||||||
for (int i : PathFinder.NEIGHBOURS9){
|
for (int i : PathFinder.NEIGHBOURS9){
|
||||||
if (Dungeon.level.map[pos+i] == Terrain.WALL || Dungeon.level.map[pos+i] == Terrain.WALL_DECO){
|
if (Dungeon.level.map[pos+i] == Terrain.WALL || Dungeon.level.map[pos+i] == Terrain.WALL_DECO){
|
||||||
Point p = Dungeon.level.cellToPoint(pos+i);
|
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
|
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);
|
Level.set(pos+i, Terrain.EMPTY_DECO);
|
||||||
GameScene.updateMap(pos+i);
|
GameScene.updateMap(pos+i);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -101,6 +101,7 @@ public class CavesBossLevel extends Level {
|
|||||||
private static int WIDTH = 33;
|
private static int WIDTH = 33;
|
||||||
private static int HEIGHT = 42;
|
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 mainArena = new Rect(5, 14, 28, 37);
|
||||||
public static Rect gate = new Rect(14, 13, 19, 14);
|
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 };
|
public static int[] pylonPositions = new int[]{ 4 + 13*WIDTH, 28 + 13*WIDTH, 4 + 37*WIDTH, 28 + 37*WIDTH };
|
||||||
|
|||||||
Reference in New Issue
Block a user