v0.4.3: fixed a bunch of crash bugs

This commit is contained in:
Evan Debenham
2016-10-01 02:38:24 -04:00
parent 794648fa21
commit e3b0720de9
4 changed files with 45 additions and 22 deletions

View File

@@ -245,7 +245,10 @@ public class Tilemap extends Visual {
while(bottomRight >= topLeft && bufferPositions[bottomRight] == -1)
bottomRight--;
length = bufferPositions[bottomRight] - bufferPositions[topLeft] + 1;
if (topLeft >= bufferPositions.length || bottomRight <= 0)
length = 0;
else
length = bufferPositions[bottomRight] - bufferPositions[topLeft] + 1;
}
if (camX >= mapWidth