summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2022-09-10 18:59:17 +0200
committerTor Andersson <tor@ccxvii.net>2022-11-17 13:11:27 +0100
commit8e209f676c6b5a8b5c1166f0d6c3366121dcd655 (patch)
treeb69bc32787aaeff7f1d11badcb6686678ccafec2 /rules.js
parent8d9c651b9fbaae3bbc448c1a53f6b63bbc198b8c (diff)
downloadrommel-in-the-desert-8e209f676c6b5a8b5c1166f0d6c3366121dcd655.tar.gz
Add checkpoints for replay.
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js7
1 files changed, 7 insertions, 0 deletions
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)