From a96e9c55c21ab8c423cadb3702b521bdef524df8 Mon Sep 17 00:00:00 2001 From: Michael Townsend Date: Tue, 29 Oct 2013 15:54:25 -0400 Subject: [PATCH] Update world.js --- script/world.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/script/world.js b/script/world.js index e4a1e3d..f53e664 100644 --- a/script/world.js +++ b/script/world.js @@ -201,7 +201,7 @@ var World = { y += dy; } } - return World.VILLAGE_POS; + return World.VILLAGE_POS; }; var closestRoad = findClosestRoad(World.curPos); var xDist = World.curPos[0] - closestRoad[0]; @@ -917,6 +917,8 @@ var World = { Engine.keyLock = false; // Explore in a temporary world-state. We'll commit the changes if you return home safe. World.state = $.extend(true, {}, $SM.get('game.world')); + // Some weirdness in jQuery's extend method is causing the map to not be deep copied... + World.state.map = $.extend(true, {}, World.state.map); World.setWater(World.getMaxWater()); World.setHp(World.getMaxHealth()); World.foodMove = 0; @@ -944,4 +946,4 @@ var World = { handleStateUpdates: function(e){ } -}; \ No newline at end of file +};