From fbf29f8510864b42f73e573ccfa04ca7827df030 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 14 Jan 2023 08:00:22 +0200 Subject: [PATCH 14/14] validity.c: Check more ways extras need universals is_universal_needed() to check if universal is in: - apprarance_reqs of some extra - disappearance_reqs of some extra - first_reqs of some road See osdn #46443 Signed-off-by: Marko Lindqvist --- tools/ruledit/validity.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tools/ruledit/validity.c b/tools/ruledit/validity.c index 95565002ab..1668a9f2c8 100644 --- a/tools/ruledit/validity.c +++ b/tools/ruledit/validity.c @@ -98,9 +98,19 @@ static bool is_universal_needed(struct universal *uni, requirers_cb cb, extra_active_type_iterate(pextra) { if (universal_is_mentioned_by_requirements(&pextra->reqs, uni) - || universal_is_mentioned_by_requirements(&pextra->rmreqs, uni)) { + || universal_is_mentioned_by_requirements(&pextra->rmreqs, uni) + || universal_is_mentioned_by_requirements(&pextra->appearance_reqs, uni) + || universal_is_mentioned_by_requirements(&pextra->disappearance_reqs, uni)) { cb(extra_rule_name(pextra), data); needed = TRUE; + } else { + struct road_type *proad = extra_road_get(pextra); + + if (proad != NULL + && universal_is_mentioned_by_requirements(&proad->first_reqs, uni)) { + cb(extra_rule_name(pextra), data); + needed = TRUE; + } } } extra_active_type_iterate_end; -- 2.39.0