From bf398132d9c36212f7c5ae6ac4489e312e7df895 Mon Sep 17 00:00:00 2001 From: Sveinung Kvilhaugsvik Date: Tue, 23 Feb 2021 09:58:49 +0100 Subject: [PATCH] req_vec_suggest_improvement(): fixes first. Suggest fixes before suggesting improvements to requirement vectors. A potential improvement can be made irrelevant by a required repair. This makes req_vec_suggest_improvement() consistent with action_enabler_suggest_improvement(). See osdn #41639 --- common/requirements.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/common/requirements.c b/common/requirements.c index 03facb4991..eb5ebeb381 100644 --- a/common/requirements.c +++ b/common/requirements.c @@ -3914,6 +3914,12 @@ req_vec_suggest_improvement(const struct requirement_vector *vec, { struct req_vec_problem *out; + out = req_vec_suggest_repair(vec, get_num, parent_item); + if (out != NULL) { + /* A bug, not just a potential improvement */ + return out; + } + /* Check if a universal that never will appear in the game is checked. */ out = req_vec_get_first_missing_univ(vec, get_num, parent_item); if (out != NULL) { -- 2.20.1