From 21a719e0c51c3db5f00b1a24b6ddcc752fb5718c Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 26 Sep 2019 18:43:24 -0400 Subject: [PATCH] v0.7.5: fixed additional crash errors caused by diamond Goo rooms --- .../levels/rooms/sewerboss/DiamondGooRoom.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/sewerboss/DiamondGooRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/sewerboss/DiamondGooRoom.java index 85efc0531..ab46ff01c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/sewerboss/DiamondGooRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/sewerboss/DiamondGooRoom.java @@ -35,6 +35,8 @@ public class DiamondGooRoom extends GooBossRoom { //we want the end width to be width()-2, and the width will grow by a total of (height()-4 - height()%2) int diamondWidth = width()-2 - (height()-4 - height()%2); + //but starting width cannot be smaller than 2 on even width, 3 on odd width. + diamondWidth = Math.max(diamondWidth, width()%2 == 0 ? 2 : 3); for (int i = 1; i < height(); i++){ Painter.fill( level, left + (width() - diamondWidth)/2, top+i, diamondWidth, height()-2*i, Terrain.EMPTY);