From f6397dca9091cba8057f62815a9eabacf02ad098 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 3 Jul 2023 16:45:43 +0200 Subject: Don't delete undo by default when patching games. --- tools/undo.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools/undo.sh') diff --git a/tools/undo.sh b/tools/undo.sh index 716e88b..889d6b8 100644 --- a/tools/undo.sh +++ b/tools/undo.sh @@ -1,10 +1,10 @@ #!/bin/bash if [ -n "$1" ] then - COUNT=$(sqlite3 db "select count(1) from game_replay where game_id=$1") + COUNT=$(sqlite3 db "select coalesce(max(replay_id),0) from game_replay where game_id=$1") echo Game has $COUNT actions. sqlite3 db "delete from game_replay where game_id=$1 and replay_id=$COUNT" - node tools/patchgame.js $1 + node tools/patchgame.js $1 '{"validate_actions":false}' else echo "usage: bash tools/undo.sh GAME" fi -- cgit v1.2.3