From 158081973f9d2f97793f39039d9e2a5221ba891e Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 1 May 2021 01:56:40 +0300 Subject: [PATCH 25/26] Make terrain transform_time of zero to disable transforming That's how it has been documented. Reported by Sveinung Kvilhaugsvik See osdn #42120 Signed-off-by: Marko Lindqvist --- server/ruleset.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/server/ruleset.c b/server/ruleset.c index 635e01a776..b002f35d43 100644 --- a/server/ruleset.c +++ b/server/ruleset.c @@ -2937,6 +2937,16 @@ static bool load_ruleset_terrain(struct section_file *file, ok = FALSE; break; } + if (pterrain->transform_time <= 0) { + /* Transform time of zero is documented to disable the transform + * regardless of given transform result. That's fine, but in the + * future we may consider it an error to give combination of + * transform_result and transform_time where one indicates it's + * enabled and the other that it's not. + * Note that we already strip transform_result when doing ruleup + * from older ruleset that has such a construct. */ + pterrain->transform_result = NULL; + } pterrain->pillage_time = 1; /* default */ lookup_time(file, &pterrain->pillage_time, tsection, "pillage_time", filename, NULL, &ok); -- 2.30.2