Fix buying maps causing crashes

Fixes the applyMap function that could not uncover single points of map on the top and left borders and thus was causing an infinite loop crash
This commit is contained in:
Roarez
2018-09-11 00:43:49 +01:00
committed by GitHub
parent 15ddf72e43
commit d498a13177
+2 -2
View File
@@ -645,8 +645,8 @@ var World = {
if(!World.seenAll){
var x,y,mask = $SM.get('game.world.mask');
do {
x = Math.floor(Math.random() * (World.RADIUS * 2) + 1);
y = Math.floor(Math.random() * (World.RADIUS * 2) + 1);
x = Math.floor(Math.random() * (World.RADIUS * 2 + 1));
y = Math.floor(Math.random() * (World.RADIUS * 2 + 1));
} while (mask[x][y]);
World.uncoverMap(x, y, 5, mask);
}