From 0834bf5bd1488fcbf84a008a39145fc19aa1e255 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Thu, 7 Oct 2021 20:05:08 +0300 Subject: [PATCH 16/16] Do not erroneously accept "Traderoute" range for a "Good" requirement Reported by ddeanbrown See osdn #42944 Signed-off-by: Marko Lindqvist --- common/requirements.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/common/requirements.c b/common/requirements.c index cba701127a..8d02ce4d4a 100644 --- a/common/requirements.c +++ b/common/requirements.c @@ -679,8 +679,8 @@ const char *req_to_fstring(const struct requirement *req) Pass this some values like "Building", "Factory". ****************************************************************************/ struct requirement req_from_str(const char *type, const char *range, - bool survives, bool present, bool quiet, - const char *value) + bool survives, bool present, bool quiet, + const char *value) { struct requirement req; bool invalid; @@ -788,10 +788,12 @@ struct requirement req_from_str(const char *type, const char *range, break; case VUT_MINSIZE: case VUT_NATIONALITY: - case VUT_GOOD: invalid = (req.range != REQ_RANGE_CITY && req.range != REQ_RANGE_TRADEROUTE); break; + case VUT_GOOD: + invalid = (req.range != REQ_RANGE_CITY); + break; case VUT_MINCULTURE: invalid = (req.range != REQ_RANGE_CITY && req.range != REQ_RANGE_TRADEROUTE -- 2.33.0