From 2ecb41004c5d59f78d078bb25e44718527ec5aad Mon Sep 17 00:00:00 2001 From: Sveinung Kvilhaugsvik Date: Mon, 8 Feb 2021 09:01:56 +0100 Subject: [PATCH] Handle buildable extras without activity cause. Make rulesave save the fact that it is buildable when it has no worker activity causes. If not buildable will default to false on the next load. This fixes rulesave's stability when saving granularity and loading the result. See osdn #41516 --- tools/ruleutil/rulesave.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ruleutil/rulesave.c b/tools/ruleutil/rulesave.c index d48a0a3331..e36c843e6e 100644 --- a/tools/ruleutil/rulesave.c +++ b/tools/ruleutil/rulesave.c @@ -2408,7 +2408,7 @@ 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) { + if (!pextra->buildable || !is_extra_caused_by_worker_action(pextra)) { secfile_insert_bool(sfile, pextra->buildable, "%s.buildable", path); } if (!pextra->generated) { -- 2.20.1