From f38d2f29ac11abeec07b099599476a136415aa4e Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Thu, 14 Apr 2022 19:06:41 +0300 Subject: [PATCH 47/47] Stop claiming that all errors from effect_list_sanity_cb() are req errors Error message about requirement sanity was being printed out when ever effect_list_sanity_cb() failed, no matter the actual error detected. See osdn #44371 Signed-off-by: Marko Lindqvist --- server/rssanity.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/server/rssanity.c b/server/rssanity.c index 4999146db0..88d6d865b2 100644 --- a/server/rssanity.c +++ b/server/rssanity.c @@ -539,8 +539,15 @@ static bool effect_list_sanity_cb(struct effect *peffect, void *data) } requirement_vector_iterate_end; } - return sanity_check_req_vec(&peffect->reqs, TRUE, one_tile, - effect_type_name(peffect->type)); + if (!sanity_check_req_vec(&peffect->reqs, TRUE, one_tile, + effect_type_name(peffect->type))) { + ruleset_error(LOG_ERROR, + "Effects have conflicting or invalid requirements!"); + + return FALSE; + } + + return TRUE; } /**********************************************************************//** @@ -984,10 +991,8 @@ bool sanity_check_ruleset_data(bool ignore_retired) } unit_type_iterate_end; /* Check requirement sets against conflicting requirements. - * Effects use requirement lists */ + * For effects check also other sanity in the same iteration */ if (!iterate_effect_cache(effect_list_sanity_cb, NULL)) { - ruleset_error(LOG_ERROR, - "Effects have conflicting or invalid requirements!"); ok = FALSE; } -- 2.35.1