From 785558267105acb586b91d398aa78721bffdf462 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Tue, 25 May 2021 02:25:06 +0300 Subject: [PATCH 46/46] is_universal_needed(): Check if needed by clause requirements See osdn #42374 Signed-off-by: Marko Lindqvist --- tools/ruledit/validity.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tools/ruledit/validity.c b/tools/ruledit/validity.c index fe7e9d3994..6ef1872aca 100644 --- a/tools/ruledit/validity.c +++ b/tools/ruledit/validity.c @@ -141,6 +141,23 @@ static bool is_universal_needed(struct universal *uni, requirers_cb cb, needed = TRUE; } + for (i = 0; i < CLAUSE_COUNT; i++) { + struct clause_info *info = clause_info_get(i); + + if (info->enabled) { + if (universal_is_mentioned_by_requirements(&info->giver_reqs, uni) + || universal_is_mentioned_by_requirements(&info->receiver_reqs, uni)) { + char buf[1024]; + + /* TRANS: e.g. "Advance clause" */ + fc_snprintf(buf, sizeof(buf), R__("%s clause"), + clause_type_name(info->type)); + cb(buf, data); + needed = TRUE; + } + } + } + cb_data.needed = FALSE; cb_data.uni = uni; cb_data.cb = cb; -- 2.30.2