From 286858a5c3f16d998e1062204d378c15bcbdecfa Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Wed, 31 May 2023 17:01:09 +0300 Subject: [PATCH 34/34] Close save system on midgame server quit Closing was taking place when game finished. See osdn #48120 Signed-off-by: Marko Lindqvist --- server/srv_main.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/server/srv_main.c b/server/srv_main.c index 2272a91ecf..fb57b336e0 100644 --- a/server/srv_main.c +++ b/server/srv_main.c @@ -1877,6 +1877,8 @@ void fc__noreturn server_quit(void) } phase_players_iterate_end; } + save_system_close(); + if (game.server.save_timer != NULL) { timer_destroy(game.server.save_timer); game.server.save_timer = NULL; @@ -3539,14 +3541,14 @@ void fc__noreturn srv_main(void) server_sniff_all_input(); } - /* Close it even between games. */ - save_system_close(); - if (game.info.timeout == -1 || srvarg.exit_on_end) { /* For autogames or if the -e option is specified, exit the server. */ server_quit(); } + /* Close it even between games. */ + save_system_close(); + /* Reset server */ server_game_free(); fc_rand_uninit(); -- 2.39.2