From 0beb658af80a322298aa06af0d52e9603453a1d8 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sun, 15 May 2022 05:02:07 +0300 Subject: [PATCH 16/16] can_build_extra_base(): Check irrigation/mine_time Make sure that the target tile irrigation/mine_time does not prevent building the extra. See osdn #44591 Signed-off-by: Marko Lindqvist --- common/extras.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/common/extras.c b/common/extras.c index 17916eaf7e..0c24a4e2af 100644 --- a/common/extras.c +++ b/common/extras.c @@ -368,6 +368,8 @@ static bool can_build_extra_base(const struct extra_type *pextra, const struct player *pplayer, const struct tile *ptile) { + struct terrain *pterr; + if (is_extra_caused_by(pextra, EC_BASE) && !base_can_be_built(extra_base_get(pextra), ptile)) { return FALSE; @@ -378,6 +380,18 @@ static bool can_build_extra_base(const struct extra_type *pextra, return FALSE; } + pterr = tile_terrain(ptile); + + if (is_extra_caused_by(pextra, EC_IRRIGATION) + && pterr->irrigation_time == 0) { + return FALSE; + } + + if (is_extra_caused_by(pextra, EC_MINE) + && pterr->mining_time == 0) { + return FALSE; + } + if (!extra_can_be_built(pextra, ptile)) { return FALSE; } -- 2.35.1