From 5eab431742256ca4ca38ed7b52d619510daa9592 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Fri, 15 Jul 2022 02:46:57 +0300 Subject: [PATCH 44/44] Sanity check that terrain resource is a resource Reported by dark-ether See osdn #45099 Signed-off-by: Marko Lindqvist --- server/rssanity.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/server/rssanity.c b/server/rssanity.c index ea381d8970..865d49410b 100644 --- a/server/rssanity.c +++ b/server/rssanity.c @@ -1357,6 +1357,16 @@ bool sanity_check_ruleset_data(struct rscompat_info *compat) ok = FALSE; } } + + terrain_resources_iterate(pterr, pres, freq) { + (void) freq; + if (!is_extra_caused_by(pres, EC_RESOURCE)) { + ruleset_error(LOG_ERROR, + "%s has %s as a resource, but it's not a resource extra.", + terrain_rule_name(pterr), extra_rule_name(pres)); + ok = FALSE; + } + } terrain_resources_iterate_end; } terrain_type_iterate_end; /* Check that all unit classes can exist somewhere */ -- 2.35.1