From 3340fa9c6f66b60d3be4046f2ac034378ffe235d Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 1 May 2021 01:57:06 +0300 Subject: [PATCH 37/39] 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 e1167e4627..d786a308cc 100644 --- a/server/ruleset.c +++ b/server/ruleset.c @@ -3373,6 +3373,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->placing_time = 1; /* default */ lookup_time(file, &pterrain->placing_time, -- 2.30.2