From 9fa3dd6e72bca6096e2a81504d5c301bf2ef2339 Mon Sep 17 00:00:00 2001 From: Sveinung Kvilhaugsvik Date: Wed, 28 Apr 2021 22:49:36 +0200 Subject: [PATCH] Check if road or base action can target terrain. The autohelp should mention that a terrain type can't have bases or roads built on it if a base or road building action is impossible. See osdn #42155 --- client/helpdata.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/helpdata.c b/client/helpdata.c index 76f34389d7..9f478cd788 100644 --- a/client/helpdata.c +++ b/client/helpdata.c @@ -3307,7 +3307,8 @@ void helptext_terrain(char *buf, size_t bufsz, struct player *pplayer, _("* You cannot build cities on this terrain.")); CATLSTR(buf, bufsz, "\n"); } - if (pterrain->road_time == 0) { + if (pterrain->road_time == 0 + || !action_id_univs_not_blocking(ACTION_ROAD, NULL, &source)) { /* Can't build roads; only mention if ruleset has buildable roads */ extra_type_by_cause_iterate(EC_ROAD, pextra) { if (pextra->buildable) { @@ -3318,7 +3319,8 @@ void helptext_terrain(char *buf, size_t bufsz, struct player *pplayer, } } extra_type_by_cause_iterate_end; } - if (pterrain->base_time == 0) { + if (pterrain->base_time == 0 + || !action_id_univs_not_blocking(ACTION_BASE, NULL, &source)) { /* Can't build bases; only mention if ruleset has buildable bases */ extra_type_by_cause_iterate(EC_BASE, pextra) { if (pextra->buildable) { -- 2.30.2