From 8dfbd0ef02d16aaa9943ed8980bfaf50484ed4a1 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Thu, 1 Jun 2023 03:46:38 +0300 Subject: [PATCH 16/16] Savegame: Fix loading acceptance of zero-clause treaties See osdn #48127 Signed-off-by: Marko Lindqvist --- server/savegame2.c | 14 +++++++------- server/savegame3.c | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/server/savegame2.c b/server/savegame2.c index 050df01582..9062858172 100644 --- a/server/savegame2.c +++ b/server/savegame2.c @@ -5046,14 +5046,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/savegame3.c b/server/savegame3.c index bf336e155d..4530c77b8b 100644 --- a/server/savegame3.c +++ b/server/savegame3.c @@ -6953,14 +6953,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