From a3b1fea4243bd4371be02ba56a1fa92cc116436a Mon Sep 17 00:00:00 2001 From: Andrea Rendine Date: Sat, 20 Feb 2016 13:17:45 +0100 Subject: [PATCH] Method and property fix World.testMap() sets World.seenAll. The latter is true when the whole map has been explored. World.testMap() is called: * on world init * on return home (when the map is updated) * on applyMap() (when the map is bought from the scout) --- script/world.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/script/world.js b/script/world.js index e97302d..df99fd6 100644 --- a/script/world.js +++ b/script/world.js @@ -163,7 +163,7 @@ var World = { Room.compassTooltip(World.dir); // Check if everything has been seen - World.seenAll = World.testMap(); + World.testMap(); //subscribe to stateUpdates $.Dispatch('stateUpdate').subscribe(World.handleStateUpdates); @@ -621,8 +621,8 @@ var World = { }, testMap: function() { - var dark; if(!World.seenAll) { + var dark; var mask = $SM.get('game.world.mask'); loop: for(var i = 0; i < mask.length; i++) { @@ -633,8 +633,8 @@ var World = { } } } + World.seenAll = !dark; } - return !dark; }, applyMap: function() { @@ -646,6 +646,7 @@ var World = { } while (mask[x][y]); World.uncoverMap(x, y, 5, mask); } + World.testMap(); }, generateMap: function() { @@ -897,7 +898,7 @@ var World = { goHome: function() { // Home safe! Commit the changes. $SM.setM('game.world', World.state); - World.seenAll = World.testMap(); + World.testMap(); if(World.state.sulphurmine && $SM.get('game.buildings["sulphur mine"]', true) === 0) { $SM.add('game.buildings["sulphur mine"]', 1);