Update world.js

This commit is contained in:
Michael Townsend
2013-10-29 15:54:25 -04:00
parent 363119717e
commit a96e9c55c2
+4 -2
View File
@@ -201,7 +201,7 @@ var World = {
y += dy; y += dy;
} }
} }
return World.VILLAGE_POS; return World.VILLAGE_POS;
}; };
var closestRoad = findClosestRoad(World.curPos); var closestRoad = findClosestRoad(World.curPos);
var xDist = World.curPos[0] - closestRoad[0]; var xDist = World.curPos[0] - closestRoad[0];
@@ -917,6 +917,8 @@ var World = {
Engine.keyLock = false; Engine.keyLock = false;
// Explore in a temporary world-state. We'll commit the changes if you return home safe. // Explore in a temporary world-state. We'll commit the changes if you return home safe.
World.state = $.extend(true, {}, $SM.get('game.world')); 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.setWater(World.getMaxWater());
World.setHp(World.getMaxHealth()); World.setHp(World.getMaxHealth());
World.foodMove = 0; World.foodMove = 0;
@@ -944,4 +946,4 @@ var World = {
handleStateUpdates: function(e){ handleStateUpdates: function(e){
} }
}; };