From 0eea22be15a00e63a88433c93c24cda8b4cf45c6 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Fri, 11 Jun 2021 03:22:22 +0300 Subject: [PATCH 24/24] is_terrain_needed(): Check if another terrain has the terrain as some _result See osdn #42505 Signed-off-by: Marko Lindqvist --- tools/ruledit/validity.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/ruledit/validity.c b/tools/ruledit/validity.c index 07bce159a6..b529104930 100644 --- a/tools/ruledit/validity.c +++ b/tools/ruledit/validity.c @@ -277,6 +277,16 @@ bool is_terrain_needed(struct terrain *pterr, requirers_cb cb, void *data) needed |= is_universal_needed(&uni, cb, data); + terrain_active_iterate(pother) { + if (pother != pterr + && (pother->irrigation_result == pterr + || pother->mining_result == pterr + || pother->transform_result == pterr)) { + cb(terrain_rule_name(pother), data); + needed = TRUE; + } + } terrain_active_iterate_end; + return needed; } -- 2.30.2