From c235a8239177d38117f3313d17b904b66a806378 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 14 Feb 2024 23:20:44 +0100 Subject: Add import-game and export-game scripts. To bulk transfer all game state, replay, and snapshots into a new game. --- tools/patchgame.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools/patchgame.js') 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 } -- cgit v1.2.3