Skip to content

Commit

Permalink
Fix buying maps causing crashes
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Roarez authored Sep 10, 2018
1 parent 15ddf72 commit d498a13
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions script/world.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit d498a13

Please sign in to comment.