summaryrefslogtreecommitdiff
path: root/tools/patchgame.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-02-14 23:20:44 +0100
committerTor Andersson <tor@ccxvii.net>2024-02-15 00:19:57 +0100
commitc235a8239177d38117f3313d17b904b66a806378 (patch)
treec023351b009a10638f4936738e8c13a5fe5f37e8 /tools/patchgame.js
parent09cae5d2f687c7df4972f58860fbc3fb9a032c1c (diff)
downloadserver-c235a8239177d38117f3313d17b904b66a806378.tar.gz
Add import-game and export-game scripts.
To bulk transfer all game state, replay, and snapshots into a new game.
Diffstat (limited to 'tools/patchgame.js')
-rwxr-xr-xtools/patchgame.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/patchgame.js b/tools/patchgame.js
index 3a21f67..e191df8 100755
--- a/tools/patchgame.js
+++ b/tools/patchgame.js
@@ -79,10 +79,10 @@ function is_valid_action(rules, state, role, action, arg) {
if (va) {
if (Array.isArray(arg))
arg = arg[0]
- if (arg === undefined || arg === null)
- return (va === 1 || va === true || typeof va === "string")
if (Array.isArray(va) && va.includes(arg))
return true
+ if (arg === undefined || arg === null || arg === 1)
+ return (va === 1 || va === true || typeof va === "string")
}
return false
}