From 2f3ad7ed2038294dbbde7d8127563af1a35c2858 Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Sat, 1 May 2021 01:54:51 +0300
Subject: [PATCH 21/22] 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 <cazfi74@gmail.com>
---
 server/ruleset.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/server/ruleset.c b/server/ruleset.c
index d904e533ab..cb21d39c33 100644
--- a/server/ruleset.c
+++ b/server/ruleset.c
@@ -2673,6 +2673,14 @@ 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. */
+        pterrain->transform_result = NULL;
+      }
       pterrain->pillage_time = 1; /* default */
       lookup_time(file, &pterrain->pillage_time,
                   tsection, "pillage_time", filename, NULL, &ok);
-- 
2.30.2