From 343a7f82e5da506154ff519696b23438fcb13b51 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Thu, 1 Jun 2023 03:46:38 +0300 Subject: [PATCH 38/38] Savegame: Fix loading acceptance of zero-clause treaties See osdn #48127 Signed-off-by: Marko Lindqvist --- server/savegame/savegame2.c | 14 +++++++------- server/savegame/savegame3.c | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/server/savegame/savegame2.c b/server/savegame/savegame2.c index f48de70463..ceee5ec457 100644 --- a/server/savegame/savegame2.c +++ b/server/savegame/savegame2.c @@ -5164,14 +5164,14 @@ static void sg_load_treaties(struct loaddata *loading) add_clause(ptreaty, pgiver, type, value); } } - - /* These must be after clauses have been added so that acceptance - * does not get cleared by what seems like changes to the treaty. */ - ptreaty->accept0 = secfile_lookup_bool_default(loading->file, FALSE, - "treaty%d.accept0", tidx); - ptreaty->accept1 = secfile_lookup_bool_default(loading->file, FALSE, - "treaty%d.accept1", tidx); } + + /* These must be after clauses have been added so that acceptance + * does not get cleared by what seems like changes to the treaty. */ + ptreaty->accept0 = secfile_lookup_bool_default(loading->file, FALSE, + "treaty%d.accept0", tidx); + ptreaty->accept1 = secfile_lookup_bool_default(loading->file, FALSE, + "treaty%d.accept1", tidx); } } } diff --git a/server/savegame/savegame3.c b/server/savegame/savegame3.c index d22facc8b7..324d31ce13 100644 --- a/server/savegame/savegame3.c +++ b/server/savegame/savegame3.c @@ -7593,14 +7593,14 @@ static void sg_load_treaties(struct loaddata *loading) add_clause(ptreaty, pgiver, type, value); } } - - /* These must be after clauses have been added so that acceptance - * does not get cleared by what seems like changes to the treaty. */ - ptreaty->accept0 = secfile_lookup_bool_default(loading->file, FALSE, - "treaty%d.accept0", tidx); - ptreaty->accept1 = secfile_lookup_bool_default(loading->file, FALSE, - "treaty%d.accept1", tidx); } + + /* These must be after clauses have been added so that acceptance + * does not get cleared by what seems like changes to the treaty. */ + ptreaty->accept0 = secfile_lookup_bool_default(loading->file, FALSE, + "treaty%d.accept0", tidx); + ptreaty->accept1 = secfile_lookup_bool_default(loading->file, FALSE, + "treaty%d.accept1", tidx); } } } -- 2.39.2