Fix future history bug
diff --git a/js/game.js b/js/game.js
index 63b632e..1901aba 100644
--- a/js/game.js
+++ b/js/game.js
@@ -1071,6 +1071,8 @@ class Game
this.describeMainCharacterLocation();
if (this.history.length == 0) {
elt('previous-history').disabled = true;
+ } else {
+ elt('previous-history').disabled = false;
}
elt('next-history').disabled = false;
}
@@ -1094,6 +1096,8 @@ class Game
this.describeMainCharacterLocation();
if (this.future_history.length == 0) {
elt('next-history').disabled = true;
+ } else {
+ elt('next-history').disabled = false;
}
elt('previous-history').disabled = false;
}
@@ -1416,7 +1420,9 @@ class Game
async function initGame()
{
game = new Game();
+ let use_session = false;
if (sessionStorage["current" + game.id]) {
+ use_session = true;
game.restoreState(sessionStorage["current" + game.id]);
}
game.takeTurn("");