From 8e209f676c6b5a8b5c1166f0d6c3366121dcd655 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 10 Sep 2022 18:59:17 +0200 Subject: Add checkpoints for replay. --- map.svg | 4 ++-- rules.js | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/map.svg b/map.svg index 01cb51a..76733a3 100644 --- a/map.svg +++ b/map.svg @@ -203,13 +203,13 @@ /> diff --git a/rules.js b/rules.js index 2a6b4f6..49dea02 100644 --- a/rules.js +++ b/rules.js @@ -6946,6 +6946,13 @@ exports.setup = function (seed, scenario, options) { return game } +exports.is_checkpoint = function (a, b) { + if (!a.log) return true + let ax = a.log[a.log.length-2].startsWith(".h2") + let bx = b.log[b.log.length-2].startsWith(".h2") + return bx && (!ax || a.log.length !== b.log.length) +} + exports.view = function(state, current) { load_state(state) -- cgit v1.2.3