v0.4.2: added some safety checks to level sizes

This commit is contained in:
Evan Debenham 2016-08-24 17:31:42 -04:00 committed by Evan Debenham
parent 3941aa3fe4
commit 0fc51654be

View File

@ -278,7 +278,8 @@ public abstract class Level implements Bundlable {
}
protected void setupSize(){
width = height = 32;
if (width == 0 || height == 0)
width = height = 32;
length = width * height;
}
@ -413,6 +414,8 @@ public abstract class Level implements Bundlable {
}
public int length() {
if (length == 0)
setupSize();
return length;
}