diff --git a/script/path.js b/script/path.js index 25689dc..e1cbb59 100644 --- a/script/path.js +++ b/script/path.js @@ -46,7 +46,7 @@ var Path = { cooldown: World.DEATH_COOLDOWN }).appendTo(this.panel); - Path.outfit = {}; + Path.outfit = $SM.get('outfit'); Engine.updateSlider(); @@ -269,6 +269,7 @@ var Path = { var maxExtraByStore = $SM.get('stores["'+supply+'"]', true) - cur; var maxExtraByBtn = btn.data; Path.outfit[supply] = cur + Math.min(maxExtraByBtn, Math.min(maxExtraByWeight, maxExtraByStore)); + $SM.set('outfit['+supply+']', Path.outfit[supply]) Path.updateOutfitting(); } }, @@ -280,6 +281,7 @@ var Path = { cur = typeof cur == 'number' ? cur : 0; if(cur > 0) { Path.outfit[supply] = Math.max(0, cur - btn.data); + $SM.set('outfit['+supply+']', Path.outfit[supply]) Path.updateOutfitting(); } }, @@ -288,6 +290,7 @@ var Path = { Path.setTitle(); Path.updateOutfitting(); Path.updatePerks(true); + $SM.set('outfit', Path.outfit); Engine.moveStoresView($('#perks'), transition_diff); }, @@ -300,6 +303,7 @@ var Path = { for(var k in Path.outfit) { $SM.add('stores["'+k+'"]', -Path.outfit[k]); } + $SM.remove('outfit'); World.onArrival(); $('#outerSlider').animate({left: '-700px'}, 300); Engine.activeModule = World; diff --git a/script/state_manager.js b/script/state_manager.js index bf2ca8a..7b33dad 100644 --- a/script/state_manager.js +++ b/script/state_manager.js @@ -35,7 +35,8 @@ var StateManager = { 'timers', 'game', //mostly location related: fire temp, workers, population, world map, etc 'playStats', //anything play related: play time, loads, etc - 'previous' // prestige, score, trophies (in future), achievements (again, not yet), etc + 'previous', // prestige, score, trophies (in future), achievements (again, not yet), etc + 'outfit' // used to temporarily store the items to be taken on the path ]; for(var which in cats) {