From 23812749f0399a7eab2929f32f360f2f4ad49f16 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Thu, 7 Oct 2021 19:58:41 +0300 Subject: [PATCH 40/40] 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 fa8db81ca3..fa7441dfad 100644 --- a/common/requirements.c +++ b/common/requirements.c @@ -739,8 +739,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; @@ -854,11 +854,13 @@ struct requirement req_from_str(const char *type, const char *range, case VUT_MINSIZE: case VUT_MINFOREIGNPCT: case VUT_NATIONALITY: - case VUT_GOOD: case VUT_CITYSTATUS: 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