From 96e1b25f2f8b1b16b0ebc613734cdafacee66bd3 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 11 Sep 2021 07:28:36 +0300 Subject: [PATCH 17/17] Rulesave: Save extra.buildable when ever it does not have a default value Reported by ddeanbrown See osdn #42848 Signed-off-by: Marko Lindqvist --- tools/ruleutil/rulesave.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/ruleutil/rulesave.c b/tools/ruleutil/rulesave.c index 9967e7b352..a9e6281726 100644 --- a/tools/ruleutil/rulesave.c +++ b/tools/ruleutil/rulesave.c @@ -2166,6 +2166,7 @@ static bool save_terrain_ruleset(const char *filename, const char *name) int flagi; int causei; int set_count; + bool worker_cause; fc_snprintf(path, sizeof(path), "extra_%d", sect_idx++); @@ -2225,7 +2226,9 @@ static bool save_terrain_ruleset(const char *filename, const char *name) save_reqs_vector(sfile, &(pextra->appearance_reqs), path, "appearance_reqs"); save_reqs_vector(sfile, &(pextra->disappearance_reqs), path, "disappearance_reqs"); - if (!pextra->buildable) { + worker_cause = is_extra_caused_by_worker_action(pextra); + if ((!pextra->buildable && worker_cause) + || (pextra->buildable && !worker_cause)) { secfile_insert_bool(sfile, pextra->buildable, "%s.buildable", path); } if (!pextra->generated) { -- 2.33.0