From f3d0f536d0af859f5f8c7866d97fca4de4f4c14f Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Fri, 11 Jun 2021 03:22:22 +0300 Subject: [PATCH 46/46] 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 71b35c88d6..285e8f2694 100644 --- a/tools/ruledit/validity.c +++ b/tools/ruledit/validity.c @@ -294,6 +294,16 @@ bool is_terrain_needed(struct terrain *pterr, requirers_cb cb, void *data) needed |= is_universal_needed(&uni, cb, data); + terrain_re_active_iterate(pother) { + if (pother != pterr + && (pother->cultivate_result == pterr + || pother->plant_result == pterr + || pother->transform_result == pterr)) { + cb(terrain_rule_name(pother), data); + needed = TRUE; + } + } terrain_re_active_iterate_end; + return needed; } -- 2.30.2