diff options
author | Tor Andersson <tor@ccxvii.net> | 2022-03-05 01:53:44 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2022-03-05 16:47:03 +0100 |
commit | a82c2e2ce844a93a749a16ac17706fa3e011d9cc (patch) | |
tree | 54f01becb30ccfbd6271b4ffffb75acbee0e20e2 /server.js | |
parent | e68627f0e43931e57f9feb92ef0ec79665fc25b9 (diff) | |
download | server-a82c2e2ce844a93a749a16ac17706fa3e011d9cc.tar.gz |
Remember options when restarting a game via debugging menu.
Diffstat (limited to 'server.js')
-rw-r--r-- | server.js | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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); |