v0.4.2: added some safety checks to level sizes
This commit is contained in:
parent
3941aa3fe4
commit
0fc51654be
|
@ -278,6 +278,7 @@ public abstract class Level implements Bundlable {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setupSize(){
|
protected void setupSize(){
|
||||||
|
if (width == 0 || height == 0)
|
||||||
width = height = 32;
|
width = height = 32;
|
||||||
length = width * height;
|
length = width * height;
|
||||||
}
|
}
|
||||||
|
@ -413,6 +414,8 @@ public abstract class Level implements Bundlable {
|
||||||
}
|
}
|
||||||
|
|
||||||
public int length() {
|
public int length() {
|
||||||
|
if (length == 0)
|
||||||
|
setupSize();
|
||||||
return length;
|
return length;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user