From d498a131777a49edc8a3f3c2394ecb9326256572 Mon Sep 17 00:00:00 2001 From: Roarez Date: Tue, 11 Sep 2018 00:43:49 +0100 Subject: [PATCH] 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 --- script/world.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/world.js b/script/world.js index f89e151..12b1950 100644 --- a/script/world.js +++ b/script/world.js @@ -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); }