summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2022-01-09 14:25:50 +0100
committerTor Andersson <tor@ccxvii.net>2022-01-09 14:46:27 +0100
commite40d9af1a6e90d295191a9b1c6e320f789c58ecf (patch)
treee093e1388e0d8e515b71e288e7b0f332f9d075fb /public
parenta059a95c67ba2ec65a5989f7870ee56958745bdc (diff)
downloadserver-e40d9af1a6e90d295191a9b1c6e320f789c58ecf.tar.gz
Treat 1 in options object same as true.
Diffstat (limited to 'public')
-rw-r--r--public/common/play.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/public/common/play.js b/public/common/play.js
index ede3a5b..9432be4 100644
--- a/public/common/play.js
+++ b/public/common/play.js
@@ -382,7 +382,7 @@ function connect_play() {
break;
case 'save':
- window.localStorage[params.title_id + "/save"] = msg;
+ window.localStorage[params.title_id + "/save"] = arg;
break;
}
}
@@ -643,7 +643,13 @@ async function init_replay() {
ss = Object.assign({}, s);
}
- eval_action(replay[p]);
+ try {
+ eval_action(replay[p]);
+ } catch (err) {
+ console.log("ERROR IN REPLAY", p, replay[p], s.state, s.automatic_disruption);
+ replay.length = p;
+ break;
+ }
replay[p].digest = adler32(JSON.stringify(s));
for (let k = p-1; k > 0; --k) {