From c8d25b1c642f4cca6ec1e32486dbe46732d53ccd Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Fri, 15 Apr 2022 06:26:48 +0300 Subject: [PATCH 23/23] rscompat: Make sure than no other extra gets considered as an resource Initialize extra->category, so that it's never ECAT_RESOURCE unless so later assigned. See osdn #44190 Signed-off-by: Marko Lindqvist --- server/ruleset.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/ruleset.c b/server/ruleset.c index d714236508..32d3e08ba9 100644 --- a/server/ruleset.c +++ b/server/ruleset.c @@ -2540,6 +2540,12 @@ static bool load_terrain_names(struct section_file *file, break; } section_strlcpy(&extra_sections[idx * MAX_SECTION_LABEL], sec_name); + + /* Initialize category to a value other than ECAT_RESOURCE, so + * we can later reliably distinguish between extras that have been + * assigned ECAT_RESOURCE in rscompat_extra_from_resource_3_0() + * and those that have not. */ + pextra->category = EC_LAST; } } } -- 2.35.1