v0.7.5: fixed additional crash errors caused by diamond Goo rooms
This commit is contained in:
parent
9e7193be71
commit
21a719e0c5
|
@ -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)
|
//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);
|
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++){
|
for (int i = 1; i < height(); i++){
|
||||||
Painter.fill( level, left + (width() - diamondWidth)/2, top+i, diamondWidth, height()-2*i, Terrain.EMPTY);
|
Painter.fill( level, left + (width() - diamondWidth)/2, top+i, diamondWidth, height()-2*i, Terrain.EMPTY);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user