From a82c2e2ce844a93a749a16ac17706fa3e011d9cc Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 5 Mar 2022 01:53:44 +0100 Subject: Remember options when restarting a game via debugging menu. --- server.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'server.js') diff --git a/server.js b/server.js index dd88d21..a8a97e1 100644 --- a/server.js +++ b/server.js @@ -1720,8 +1720,9 @@ function broadcast_presence(game_id) { function on_restart(socket, scenario) { try { let seed = random_seed(); - let state = socket.rules.setup(seed, scenario, {}, socket.players); - put_replay(socket.game_id, null, 'setup', [seed, scenario, null, socket.players]); + let options = JSON.parse(SQL_SELECT_GAME.get(socket.game_id).options); + let state = socket.rules.setup(seed, scenario, options, socket.players); + put_replay(socket.game_id, null, 'setup', [seed, scenario, options, socket.players]); for (let other of clients[socket.game_id]) { other.seen = 0; send_state(other, state); -- cgit v1.2.3