From ceebb9a201448e68320c9de80a35c2498acd6e38 Mon Sep 17 00:00:00 2001 From: Sveinung Kvilhaugsvik Date: Mon, 3 May 2021 07:53:59 +0200 Subject: [PATCH] Make the irrigation_time > 0 hard req obligatory. See osdn #42157 --- client/control.c | 4 +--- client/gui-gtk-3.0/citydlg.c | 3 +-- client/gui-gtk-3.0/helpdlg.c | 3 +-- client/gui-gtk-3.22/citydlg.c | 3 +-- client/gui-gtk-3.22/helpdlg.c | 3 +-- client/gui-gtk-4.0/citydlg.c | 3 +-- client/gui-gtk-4.0/helpdlg.c | 3 +-- client/gui-qt/citydlg.cpp | 4 +--- client/gui-qt/helpdlg.cpp | 3 +-- common/actions.c | 16 +++++++++----- data/alien/game.ruleset | 34 ++++++++++++++++++----------- data/civ1/game.ruleset | 15 +++++++------ data/civ2/game.ruleset | 15 +++++++------ data/civ2civ3/game.ruleset | 38 +++++++++++++++++++-------------- data/classic/game.ruleset | 15 +++++++------ data/experimental/game.ruleset | 15 +++++++------ data/multiplayer/game.ruleset | 15 +++++++------ data/sandbox/game.ruleset | 38 +++++++++++++++++++-------------- data/webperimental/game.ruleset | 15 +++++++------ doc/README.actions | 2 +- tools/civmanual.c | 5 ++--- 21 files changed, 143 insertions(+), 109 deletions(-) diff --git a/client/control.c b/client/control.c index 117312d25f..4743739be0 100644 --- a/client/control.c +++ b/client/control.c @@ -1382,7 +1382,6 @@ bool can_unit_do_connect(struct unit *punit, struct extra_type *tgt) { struct tile *ptile = unit_tile(punit); - struct terrain *pterrain = tile_terrain(ptile); struct road_type *proad = NULL; /* HACK: This code duplicates that in @@ -1430,8 +1429,7 @@ bool can_unit_do_connect(struct unit *punit, &tgt->reqs, RPT_POSSIBLE); } - return pterrain->irrigation_time != 0 - && can_be_irrigated(ptile, punit) + return can_be_irrigated(ptile, punit) && can_build_extra(tgt, punit, ptile) && !is_activity_on_tile(ptile, ACTIVITY_MINE); diff --git a/client/gui-gtk-3.0/citydlg.c b/client/gui-gtk-3.0/citydlg.c index f79ed20a09..354ae6442a 100644 --- a/client/gui-gtk-3.0/citydlg.c +++ b/client/gui-gtk-3.0/citydlg.c @@ -2947,8 +2947,7 @@ static void popup_workertask_dlg(struct city *pcity, struct tile *ptile) G_CALLBACK(set_city_workertask), GINT_TO_POINTER(ACTIVITY_PLANT), FALSE, NULL); } - if (pterr->irrigation_time != 0 - && action_id_univs_not_blocking(ACTION_IRRIGATE, NULL, &for_terr)) { + if (action_id_univs_not_blocking(ACTION_IRRIGATE, NULL, &for_terr)) { choice_dialog_add(shl, _("Irrigate"), G_CALLBACK(set_city_workertask), GINT_TO_POINTER(ACTIVITY_IRRIGATE), FALSE, NULL); diff --git a/client/gui-gtk-3.0/helpdlg.c b/client/gui-gtk-3.0/helpdlg.c index 4528c8c210..466ecb689b 100644 --- a/client/gui-gtk-3.0/helpdlg.c +++ b/client/gui-gtk-3.0/helpdlg.c @@ -1280,8 +1280,7 @@ static void help_update_terrain(const struct help_item *pitem, HELP_TERRAIN, buf); } - if (pterrain->irrigation_time != 0 - && action_id_univs_not_blocking(ACTION_IRRIGATE, NULL, &for_terr)) { + if (action_id_univs_not_blocking(ACTION_IRRIGATE, NULL, &for_terr)) { help_extras_of_act_for_terrain(pterrain, ACTIVITY_IRRIGATE, _("Build as irrigation")); } if (action_id_univs_not_blocking(ACTION_MINE, NULL, &for_terr)) { diff --git a/client/gui-gtk-3.22/citydlg.c b/client/gui-gtk-3.22/citydlg.c index 71e00bd213..04640e667a 100644 --- a/client/gui-gtk-3.22/citydlg.c +++ b/client/gui-gtk-3.22/citydlg.c @@ -2964,8 +2964,7 @@ static void popup_workertask_dlg(struct city *pcity, struct tile *ptile) G_CALLBACK(set_city_workertask), GINT_TO_POINTER(ACTIVITY_PLANT), FALSE, NULL); } - if (pterr->irrigation_time != 0 - && action_id_univs_not_blocking(ACTION_IRRIGATE, NULL, &for_terr)) { + if (action_id_univs_not_blocking(ACTION_IRRIGATE, NULL, &for_terr)) { choice_dialog_add(shl, _("Irrigate"), G_CALLBACK(set_city_workertask), GINT_TO_POINTER(ACTIVITY_IRRIGATE), FALSE, NULL); diff --git a/client/gui-gtk-3.22/helpdlg.c b/client/gui-gtk-3.22/helpdlg.c index 38332d5374..80f2a497d8 100644 --- a/client/gui-gtk-3.22/helpdlg.c +++ b/client/gui-gtk-3.22/helpdlg.c @@ -1280,8 +1280,7 @@ static void help_update_terrain(const struct help_item *pitem, HELP_TERRAIN, buf); } - if (pterrain->irrigation_time != 0 - && action_id_univs_not_blocking(ACTION_IRRIGATE, NULL, &for_terr)) { + if (action_id_univs_not_blocking(ACTION_IRRIGATE, NULL, &for_terr)) { help_extras_of_act_for_terrain(pterrain, ACTIVITY_IRRIGATE, _("Build as irrigation")); } if (action_id_univs_not_blocking(ACTION_MINE, NULL, &for_terr)) { diff --git a/client/gui-gtk-4.0/citydlg.c b/client/gui-gtk-4.0/citydlg.c index 530525c901..242f6c3fdc 100644 --- a/client/gui-gtk-4.0/citydlg.c +++ b/client/gui-gtk-4.0/citydlg.c @@ -2979,8 +2979,7 @@ static void popup_workertask_dlg(struct city *pcity, struct tile *ptile) G_CALLBACK(set_city_workertask), GINT_TO_POINTER(ACTIVITY_PLANT), FALSE, NULL); } - if (pterr->irrigation_time != 0 - && action_id_univs_not_blocking(ACTION_IRRIGATE, NULL, &for_terr)) { + if (action_id_univs_not_blocking(ACTION_IRRIGATE, NULL, &for_terr)) { choice_dialog_add(shl, _("Irrigate"), G_CALLBACK(set_city_workertask), GINT_TO_POINTER(ACTIVITY_IRRIGATE), FALSE, NULL); diff --git a/client/gui-gtk-4.0/helpdlg.c b/client/gui-gtk-4.0/helpdlg.c index 8d469c7ce2..48c89ff4f1 100644 --- a/client/gui-gtk-4.0/helpdlg.c +++ b/client/gui-gtk-4.0/helpdlg.c @@ -1287,8 +1287,7 @@ static void help_update_terrain(const struct help_item *pitem, HELP_TERRAIN, buf); } - if (pterrain->irrigation_time != 0 - && action_id_univs_not_blocking(ACTION_IRRIGATE, NULL, &for_terr)) { + if (action_id_univs_not_blocking(ACTION_IRRIGATE, NULL, &for_terr)) { help_extras_of_act_for_terrain(pterrain, ACTIVITY_IRRIGATE, _("Build as irrigation")); } if (action_id_univs_not_blocking(ACTION_MINE, NULL, &for_terr)) { diff --git a/client/gui-qt/citydlg.cpp b/client/gui-qt/citydlg.cpp index 2527ee11c4..edb58f1f27 100644 --- a/client/gui-qt/citydlg.cpp +++ b/client/gui-qt/citydlg.cpp @@ -1391,9 +1391,7 @@ void city_map::context_menu(QPoint point) && action_id_univs_not_blocking(ACTION_CULTIVATE, NULL, &for_terr)) { con_cultivate = con_menu->addAction(_("Cultivate")); } - if (pterr->irrigation_time != 0 - && action_id_univs_not_blocking(ACTION_IRRIGATE, - NULL, &for_terr)) { + if (action_id_univs_not_blocking(ACTION_IRRIGATE, NULL, &for_terr)) { con_irrig = con_menu->addAction(_("Irrigate")); } diff --git a/client/gui-qt/helpdlg.cpp b/client/gui-qt/helpdlg.cpp index 0208050fef..29bcc67ee3 100644 --- a/client/gui-qt/helpdlg.cpp +++ b/client/gui-qt/helpdlg.cpp @@ -1387,8 +1387,7 @@ void help_widget::set_topic_terrain(const help_item *topic, info_layout->addWidget(tb); } - if (pterrain->irrigation_time != 0 - && action_id_univs_not_blocking(ACTION_IRRIGATE, NULL, &for_terr)) { + if (action_id_univs_not_blocking(ACTION_IRRIGATE, NULL, &for_terr)) { /* TRANS: this and similar literal strings interpreted as (Qt) HTML */ add_extras_of_act_for_terrain(pterrain, ACTIVITY_IRRIGATE, _("Build as irrigation")); } diff --git a/common/actions.c b/common/actions.c index 75e94cf976..354ef26a4d 100644 --- a/common/actions.c +++ b/common/actions.c @@ -529,6 +529,17 @@ static void hard_code_oblig_hard_reqs(void) /* Why this is a hard requirement: Preserve semantics of the rule that a *_time of 0 disables the action. */ + oblig_hard_req_register(req_from_values(VUT_TERRAINALTER, REQ_RANGE_LOCAL, + FALSE, FALSE, FALSE, + TA_CAN_IRRIGATE), + TRUE, + N_("All action enablers for %s must require" + " that the target" + " tile's terrain's irrigation_time" + " is above 0. (See \"TerrainAlter\"'s" + " \"CanIrrigate\")"), + ACTRES_IRRIGATE, + ACTRES_NONE); oblig_hard_req_register(req_from_values(VUT_TERRAINALTER, REQ_RANGE_LOCAL, FALSE, FALSE, FALSE, TA_CAN_MINE), @@ -4208,11 +4219,6 @@ is_action_possible(const action_id wanted_action, return TRI_NO; } - pterrain = tile_terrain(target_tile); - if (pterrain->irrigation_time == 0) { - return TRI_NO; - } - if (!can_build_extra(target_extra, actor_unit, target_tile)) { return TRI_NO; } diff --git a/data/alien/game.ruleset b/data/alien/game.ruleset index 905f7778f3..6106d0bbe9 100644 --- a/data/alien/game.ruleset +++ b/data/alien/game.ruleset @@ -1028,8 +1028,9 @@ actor_reqs = "Tech", "Manufacturing", "Player" } target_reqs = - { "type", "name", "range" - "TerrainClass", "Oceanic", "CAdjacent" + { "type", "name", "range" + "TerrainClass", "Oceanic", "CAdjacent" + "TerrainAlter", "CanIrrigate", "Local" } [actionenabler_irrigate_src_green_river] @@ -1040,8 +1041,9 @@ actor_reqs = "Tech", "Manufacturing", "Player" } target_reqs = - { "type", "name", "range" - "Extra", "Green River", "Local" + { "type", "name", "range" + "Extra", "Green River", "Local" + "TerrainAlter", "CanIrrigate", "Local" } [actionenabler_irrigate_src_brown_river] @@ -1052,8 +1054,9 @@ actor_reqs = "Tech", "Manufacturing", "Player" } target_reqs = - { "type", "name", "range" - "Extra", "Brown River", "Local" + { "type", "name", "range" + "Extra", "Brown River", "Local" + "TerrainAlter", "CanIrrigate", "Local" } [actionenabler_irrigate_src_green_river_adjacent] @@ -1064,8 +1067,9 @@ actor_reqs = "Tech", "Water Flow", "Player" } target_reqs = - { "type", "name", "range" - "Extra", "Green River", "CAdjacent" + { "type", "name", "range" + "Extra", "Green River", "CAdjacent" + "TerrainAlter", "CanIrrigate", "Local" } [actionenabler_irrigate_src_brown_river_adjacent] @@ -1076,8 +1080,9 @@ actor_reqs = "Tech", "Water Flow", "Player" } target_reqs = - { "type", "name", "range" - "Extra", "Brown River", "CAdjacent" + { "type", "name", "range" + "Extra", "Brown River", "CAdjacent" + "TerrainAlter", "CanIrrigate", "Local" } [actionenabler_irrigate_src_citycenter] @@ -1088,8 +1093,9 @@ actor_reqs = "Tech", "Water Flow", "Player" } target_reqs = - { "type", "name", "range" - "CityTile", "Center", "Adjacent" + { "type", "name", "range" + "CityTile", "Center", "Adjacent" + "TerrainAlter", "CanIrrigate", "Local" } [actionenabler_irrigate_src_deep_pumping] @@ -1099,6 +1105,10 @@ actor_reqs = "UnitFlag", "Settlers", "Local" "Tech", "Deep Pumping", "Player" } +target_reqs = + { "type", "name", "range" + "TerrainAlter", "CanIrrigate", "Local" + } [actionenabler_alight] action = "Transport Alight" diff --git a/data/civ1/game.ruleset b/data/civ1/game.ruleset index a7c617136c..23ce0e24e7 100644 --- a/data/civ1/game.ruleset +++ b/data/civ1/game.ruleset @@ -890,8 +890,9 @@ actor_reqs = "UnitFlag", "Settlers", "Local" } target_reqs = - { "type", "name", "range" - "TerrainClass", "Oceanic", "CAdjacent" + { "type", "name", "range" + "TerrainClass", "Oceanic", "CAdjacent" + "TerrainAlter", "CanIrrigate", "Local" } [actionenabler_irrigate_src_river] @@ -901,8 +902,9 @@ actor_reqs = "UnitFlag", "Settlers", "Local" } target_reqs = - { "type", "name", "range" - "Extra", "River", "CAdjacent" + { "type", "name", "range" + "Extra", "River", "CAdjacent" + "TerrainAlter", "CanIrrigate", "Local" } [actionenabler_irrigate_src_irrigation] @@ -912,8 +914,9 @@ actor_reqs = "UnitFlag", "Settlers", "Local" } target_reqs = - { "type", "name", "range" - "Extra", "Irrigation", "CAdjacent" + { "type", "name", "range" + "Extra", "Irrigation", "CAdjacent" + "TerrainAlter", "CanIrrigate", "Local" } [actionenabler_alight] diff --git a/data/civ2/game.ruleset b/data/civ2/game.ruleset index 8b5419221b..1a8351cf11 100644 --- a/data/civ2/game.ruleset +++ b/data/civ2/game.ruleset @@ -1212,8 +1212,9 @@ actor_reqs = "UnitFlag", "Settlers", "Local" } target_reqs = - { "type", "name", "range" - "TerrainClass", "Oceanic", "CAdjacent" + { "type", "name", "range" + "TerrainClass", "Oceanic", "CAdjacent" + "TerrainAlter", "CanIrrigate", "Local" } [actionenabler_irrigate_src_river] @@ -1223,8 +1224,9 @@ actor_reqs = "UnitFlag", "Settlers", "Local" } target_reqs = - { "type", "name", "range" - "Extra", "River", "CAdjacent" + { "type", "name", "range" + "Extra", "River", "CAdjacent" + "TerrainAlter", "CanIrrigate", "Local" } [actionenabler_irrigate_src_irrigation] @@ -1234,8 +1236,9 @@ actor_reqs = "UnitFlag", "Settlers", "Local" } target_reqs = - { "type", "name", "range" - "Extra", "Irrigation", "CAdjacent" + { "type", "name", "range" + "Extra", "Irrigation", "CAdjacent" + "TerrainAlter", "CanIrrigate", "Local" } [actionenabler_alight] diff --git a/data/civ2civ3/game.ruleset b/data/civ2civ3/game.ruleset index 8b071578ee..a32f978faa 100644 --- a/data/civ2civ3/game.ruleset +++ b/data/civ2civ3/game.ruleset @@ -1387,8 +1387,9 @@ actor_reqs = "UnitClass", "Sea", "Local", FALSE } target_reqs = - { "type", "name", "range", "present" - "Extra", "Irrigation", "Local", FALSE + { "type", "name", "range", "present" + "Extra", "Irrigation", "Local", FALSE + "TerrainAlter", "CanIrrigate", "Local", TRUE } [actionenabler_irrigate_src_ocean_basic_irrigation] @@ -1399,9 +1400,10 @@ actor_reqs = "UnitClass", "Sea", "Local", FALSE } target_reqs = - { "type", "name", "range", "present" - "TerrainClass", "Oceanic", "CAdjacent", TRUE - "Extra", "Irrigation", "Local", FALSE + { "type", "name", "range", "present" + "TerrainClass", "Oceanic", "CAdjacent", TRUE + "Extra", "Irrigation", "Local", FALSE + "TerrainAlter", "CanIrrigate", "Local", TRUE } [actionenabler_irrigate_src_extra_basic_irrigation] @@ -1412,9 +1414,10 @@ actor_reqs = "UnitClass", "Sea", "Local", FALSE } target_reqs = - { "type", "name", "range", "present" - "ExtraFlag", "IrrigationSource", "CAdjacent", TRUE - "Extra", "Irrigation", "Local", FALSE + { "type", "name", "range", "present" + "ExtraFlag", "IrrigationSource", "CAdjacent", TRUE + "Extra", "Irrigation", "Local", FALSE + "TerrainAlter", "CanIrrigate", "Local", TRUE } [actionenabler_irrigate_src_tech_not_in_desert] @@ -1426,8 +1429,9 @@ actor_reqs = "UnitClass", "Sea", "Local", FALSE } target_reqs = - { "type", "name", "range", "present" - "Terrain", "Desert", "Local", FALSE + { "type", "name", "range", "present" + "Terrain", "Desert", "Local", FALSE + "TerrainAlter", "CanIrrigate", "Local", TRUE } [actionenabler_irrigate_src_ocean_not_in_desert] @@ -1438,9 +1442,10 @@ actor_reqs = "UnitClass", "Sea", "Local", FALSE } target_reqs = - { "type", "name", "range", "present" - "TerrainClass", "Oceanic", "CAdjacent", TRUE - "Terrain", "Desert", "Local", FALSE + { "type", "name", "range", "present" + "TerrainClass", "Oceanic", "CAdjacent", TRUE + "Terrain", "Desert", "Local", FALSE + "TerrainAlter", "CanIrrigate", "Local", TRUE } [actionenabler_irrigate_src_extra_not_in_desert] @@ -1451,9 +1456,10 @@ actor_reqs = "UnitClass", "Sea", "Local", FALSE } target_reqs = - { "type", "name", "range", "present" - "ExtraFlag", "IrrigationSource", "CAdjacent", TRUE - "Terrain", "Desert", "Local", FALSE + { "type", "name", "range", "present" + "ExtraFlag", "IrrigationSource", "CAdjacent", TRUE + "Terrain", "Desert", "Local", FALSE + "TerrainAlter", "CanIrrigate", "Local", TRUE } [actionenabler_irrigate_src_tech_desert_but_allowed] diff --git a/data/classic/game.ruleset b/data/classic/game.ruleset index fc03318db4..38e0990fde 100644 --- a/data/classic/game.ruleset +++ b/data/classic/game.ruleset @@ -1352,8 +1352,9 @@ actor_reqs = "UnitFlag", "Settlers", "Local" } target_reqs = - { "type", "name", "range" - "TerrainClass", "Oceanic", "CAdjacent" + { "type", "name", "range" + "TerrainClass", "Oceanic", "CAdjacent" + "TerrainAlter", "CanIrrigate", "Local" } [actionenabler_irrigate_src_river] @@ -1363,8 +1364,9 @@ actor_reqs = "UnitFlag", "Settlers", "Local" } target_reqs = - { "type", "name", "range" - "Extra", "River", "CAdjacent" + { "type", "name", "range" + "Extra", "River", "CAdjacent" + "TerrainAlter", "CanIrrigate", "Local" } [actionenabler_irrigate_src_irrigation] @@ -1374,8 +1376,9 @@ actor_reqs = "UnitFlag", "Settlers", "Local" } target_reqs = - { "type", "name", "range" - "Extra", "Irrigation", "CAdjacent" + { "type", "name", "range" + "Extra", "Irrigation", "CAdjacent" + "TerrainAlter", "CanIrrigate", "Local" } [actionenabler_alight] diff --git a/data/experimental/game.ruleset b/data/experimental/game.ruleset index 92644d0b1f..b7a8fa22fe 100644 --- a/data/experimental/game.ruleset +++ b/data/experimental/game.ruleset @@ -1371,8 +1371,9 @@ actor_reqs = "UnitFlag", "Settlers", "Local" } target_reqs = - { "type", "name", "range" - "TerrainClass", "Oceanic", "CAdjacent" + { "type", "name", "range" + "TerrainClass", "Oceanic", "CAdjacent" + "TerrainAlter", "CanIrrigate", "Local" } [actionenabler_irrigate_src_river] @@ -1382,8 +1383,9 @@ actor_reqs = "UnitFlag", "Settlers", "Local" } target_reqs = - { "type", "name", "range" - "Extra", "River", "CAdjacent" + { "type", "name", "range" + "Extra", "River", "CAdjacent" + "TerrainAlter", "CanIrrigate", "Local" } [actionenabler_irrigate_src_irrigation] @@ -1393,8 +1395,9 @@ actor_reqs = "UnitFlag", "Settlers", "Local" } target_reqs = - { "type", "name", "range" - "Extra", "Irrigation", "CAdjacent" + { "type", "name", "range" + "Extra", "Irrigation", "CAdjacent" + "TerrainAlter", "CanIrrigate", "Local" } [actionenabler_alight] diff --git a/data/multiplayer/game.ruleset b/data/multiplayer/game.ruleset index 0c3cac0be9..e654f1bb24 100644 --- a/data/multiplayer/game.ruleset +++ b/data/multiplayer/game.ruleset @@ -1343,8 +1343,9 @@ actor_reqs = "UnitFlag", "Settlers", "Local" } target_reqs = - { "type", "name", "range" - "TerrainClass", "Oceanic", "CAdjacent" + { "type", "name", "range" + "TerrainClass", "Oceanic", "CAdjacent" + "TerrainAlter", "CanIrrigate", "Local" } [actionenabler_irrigate_src_river] @@ -1354,8 +1355,9 @@ actor_reqs = "UnitFlag", "Settlers", "Local" } target_reqs = - { "type", "name", "range" - "Extra", "River", "CAdjacent" + { "type", "name", "range" + "Extra", "River", "CAdjacent" + "TerrainAlter", "CanIrrigate", "Local" } [actionenabler_irrigate_src_irrigation] @@ -1365,8 +1367,9 @@ actor_reqs = "UnitFlag", "Settlers", "Local" } target_reqs = - { "type", "name", "range" - "Extra", "Irrigation", "CAdjacent" + { "type", "name", "range" + "Extra", "Irrigation", "CAdjacent" + "TerrainAlter", "CanIrrigate", "Local" } [actionenabler_alight] diff --git a/data/sandbox/game.ruleset b/data/sandbox/game.ruleset index 29e6568805..4f907e757e 100644 --- a/data/sandbox/game.ruleset +++ b/data/sandbox/game.ruleset @@ -2603,8 +2603,9 @@ actor_reqs = "UnitClass", "Sea", "Local", FALSE } target_reqs = - { "type", "name", "range", "present" - "Extra", "Irrigation", "Local", FALSE + { "type", "name", "range", "present" + "Extra", "Irrigation", "Local", FALSE + "TerrainAlter", "CanIrrigate", "Local", TRUE } [actionenabler_irrigate_src_ocean_basic_irrigation] @@ -2615,9 +2616,10 @@ actor_reqs = "UnitClass", "Sea", "Local", FALSE } target_reqs = - { "type", "name", "range", "present" - "TerrainClass", "Oceanic", "CAdjacent", TRUE - "Extra", "Irrigation", "Local", FALSE + { "type", "name", "range", "present" + "TerrainClass", "Oceanic", "CAdjacent", TRUE + "Extra", "Irrigation", "Local", FALSE + "TerrainAlter", "CanIrrigate", "Local", TRUE } [actionenabler_irrigate_src_extra_basic_irrigation] @@ -2628,9 +2630,10 @@ actor_reqs = "UnitClass", "Sea", "Local", FALSE } target_reqs = - { "type", "name", "range", "present" - "ExtraFlag", "IrrigationSource", "CAdjacent", TRUE - "Extra", "Irrigation", "Local", FALSE + { "type", "name", "range", "present" + "ExtraFlag", "IrrigationSource", "CAdjacent", TRUE + "Extra", "Irrigation", "Local", FALSE + "TerrainAlter", "CanIrrigate", "Local", TRUE } [actionenabler_irrigate_src_tech_not_in_desert] @@ -2642,8 +2645,9 @@ actor_reqs = "UnitClass", "Sea", "Local", FALSE } target_reqs = - { "type", "name", "range", "present" - "Terrain", "Desert", "Local", FALSE + { "type", "name", "range", "present" + "Terrain", "Desert", "Local", FALSE + "TerrainAlter", "CanIrrigate", "Local", TRUE } [actionenabler_irrigate_src_ocean_not_in_desert] @@ -2654,9 +2658,10 @@ actor_reqs = "UnitClass", "Sea", "Local", FALSE } target_reqs = - { "type", "name", "range", "present" - "TerrainClass", "Oceanic", "CAdjacent", TRUE - "Terrain", "Desert", "Local", FALSE + { "type", "name", "range", "present" + "TerrainClass", "Oceanic", "CAdjacent", TRUE + "Terrain", "Desert", "Local", FALSE + "TerrainAlter", "CanIrrigate", "Local", TRUE } [actionenabler_irrigate_src_extra_not_in_desert] @@ -2667,9 +2672,10 @@ actor_reqs = "UnitClass", "Sea", "Local", FALSE } target_reqs = - { "type", "name", "range", "present" - "ExtraFlag", "IrrigationSource", "CAdjacent", TRUE - "Terrain", "Desert", "Local", FALSE + { "type", "name", "range", "present" + "ExtraFlag", "IrrigationSource", "CAdjacent", TRUE + "Terrain", "Desert", "Local", FALSE + "TerrainAlter", "CanIrrigate", "Local", TRUE } [actionenabler_irrigate_src_tech_desert_but_allowed] diff --git a/data/webperimental/game.ruleset b/data/webperimental/game.ruleset index d7f6f8ad6c..9d91472fce 100644 --- a/data/webperimental/game.ruleset +++ b/data/webperimental/game.ruleset @@ -1638,8 +1638,9 @@ actor_reqs = "UnitFlag", "Settlers", "Local" } target_reqs = - { "type", "name", "range" - "TerrainClass", "Oceanic", "CAdjacent" + { "type", "name", "range" + "TerrainClass", "Oceanic", "CAdjacent" + "TerrainAlter", "CanIrrigate", "Local" } [actionenabler_irrigate_src_river] @@ -1649,8 +1650,9 @@ actor_reqs = "UnitFlag", "Settlers", "Local" } target_reqs = - { "type", "name", "range" - "Extra", "River", "CAdjacent" + { "type", "name", "range" + "Extra", "River", "CAdjacent" + "TerrainAlter", "CanIrrigate", "Local" } [actionenabler_irrigate_src_irrigation] @@ -1660,8 +1662,9 @@ actor_reqs = "UnitFlag", "Settlers", "Local" } target_reqs = - { "type", "name", "range" - "Extra", "Irrigation", "CAdjacent" + { "type", "name", "range" + "Extra", "Irrigation", "CAdjacent" + "TerrainAlter", "CanIrrigate", "Local" } [actionenabler_alight] diff --git a/doc/README.actions b/doc/README.actions index 045372dea0..04dca95a09 100644 --- a/doc/README.actions +++ b/doc/README.actions @@ -1129,7 +1129,7 @@ Actions done by a unit against a tile * the target extra (the extra to be built) is an irrigation * the target tile doesn't already have the target extra * the target extra is buildable (see extra type's buildable) - * the target tile's terrain's irrigation_time isn't 0 + * the target tile's terrain's irrigation_time is above 0 (!) * if the target extra is both an irrigation and a base the target tile's terrain's base_time isn't 0 * if the target extra is both an irrigation and a base the target extra diff --git a/tools/civmanual.c b/tools/civmanual.c index 1203e40852..afbc72993c 100644 --- a/tools/civmanual.c +++ b/tools/civmanual.c @@ -510,9 +510,8 @@ static bool manual_command(struct tag_types *tag_info) pterrain->movement_cost, pterrain->defense_bonus); fprintf(doc, "\n"); - if (pterrain->irrigation_time != 0 - && action_id_univs_not_blocking(ACTION_IRRIGATE, - NULL, &for_terr)) { + if (action_id_univs_not_blocking(ACTION_IRRIGATE, + NULL, &for_terr)) { fprintf(doc, "\n", pterrain->irrigation_food_incr, pterrain->irrigation_time); } else { -- 2.30.2
+%d F(%d)