From 44b0efc1d7ce780572c2e7c0bb5d920adafe21e3 Mon Sep 17 00:00:00 2001 From: Sveinung Kvilhaugsvik Date: Sat, 6 Feb 2021 13:12:09 +0100 Subject: [PATCH] ruleset.c: 3.2 won't need to read force_*. Remove compatibility code introduced in hrm Feature #919172 for force_capture_units, force_bombard and force_explode_nuclear from Freeciv 3.2. See osdn #41492 --- server/ruleset.c | 126 ----------------------------------------------- 1 file changed, 126 deletions(-) diff --git a/server/ruleset.c b/server/ruleset.c index c42d9f2b1c..0b66431ccc 100644 --- a/server/ruleset.c +++ b/server/ruleset.c @@ -6464,132 +6464,6 @@ static bool load_ruleset_game(struct section_file *file, bool act, /* section: actions */ if (ok) { - if (compat->compat_mode && compat->ver_game < 20) { - int force_capture_units, force_bombard, force_explode_nuclear; - - if (secfile_lookup_bool_default(file, FALSE, - "actions.force_trade_route")) { - /* Forbid entering the marketplace when a trade route can be - * established. */ - BV_SET(action_by_number(ACTION_MARKETPLACE)->blocked_by, - ACTION_TRADE_ROUTE); - } - - /* Forbid bombarding, exploading nuclear or attacking when it is - * legal to capture units. */ - force_capture_units - = secfile_lookup_bool_default(file, - FALSE, - "actions.force_capture_units"); - - if (force_capture_units) { - BV_SET(action_by_number(ACTION_BOMBARD)->blocked_by, - ACTION_CAPTURE_UNITS); - BV_SET(action_by_number(ACTION_BOMBARD2)->blocked_by, - ACTION_CAPTURE_UNITS); - BV_SET(action_by_number(ACTION_BOMBARD3)->blocked_by, - ACTION_CAPTURE_UNITS); - BV_SET(action_by_number(ACTION_NUKE)->blocked_by, - ACTION_CAPTURE_UNITS); - BV_SET(action_by_number(ACTION_NUKE_CITY)->blocked_by, - ACTION_CAPTURE_UNITS); - BV_SET(action_by_number(ACTION_NUKE_UNITS)->blocked_by, - ACTION_CAPTURE_UNITS); - BV_SET(action_by_number(ACTION_SUICIDE_ATTACK)->blocked_by, - ACTION_CAPTURE_UNITS); - BV_SET(action_by_number(ACTION_ATTACK)->blocked_by, - ACTION_CAPTURE_UNITS); - BV_SET(action_by_number(ACTION_CONQUER_CITY)->blocked_by, - ACTION_CAPTURE_UNITS); - BV_SET(action_by_number(ACTION_CONQUER_CITY2)->blocked_by, - ACTION_CAPTURE_UNITS); - } - - /* Forbid exploding nuclear or attacking when it is legal to - * bombard. */ - force_bombard - = secfile_lookup_bool_default(file, FALSE, - "actions.force_bombard"); - - if (force_bombard) { - BV_SET(action_by_number(ACTION_NUKE)->blocked_by, - ACTION_BOMBARD); - BV_SET(action_by_number(ACTION_NUKE_CITY)->blocked_by, - ACTION_BOMBARD); - BV_SET(action_by_number(ACTION_NUKE_UNITS)->blocked_by, - ACTION_BOMBARD); - BV_SET(action_by_number(ACTION_SUICIDE_ATTACK)->blocked_by, - ACTION_BOMBARD); - BV_SET(action_by_number(ACTION_ATTACK)->blocked_by, - ACTION_BOMBARD); - BV_SET(action_by_number(ACTION_CONQUER_CITY)->blocked_by, - ACTION_BOMBARD); - BV_SET(action_by_number(ACTION_CONQUER_CITY2)->blocked_by, - ACTION_BOMBARD); - BV_SET(action_by_number(ACTION_NUKE)->blocked_by, - ACTION_BOMBARD2); - BV_SET(action_by_number(ACTION_NUKE_CITY)->blocked_by, - ACTION_BOMBARD2); - BV_SET(action_by_number(ACTION_NUKE_UNITS)->blocked_by, - ACTION_BOMBARD2); - BV_SET(action_by_number(ACTION_SUICIDE_ATTACK)->blocked_by, - ACTION_BOMBARD2); - BV_SET(action_by_number(ACTION_ATTACK)->blocked_by, - ACTION_BOMBARD2); - BV_SET(action_by_number(ACTION_CONQUER_CITY)->blocked_by, - ACTION_BOMBARD2); - BV_SET(action_by_number(ACTION_CONQUER_CITY2)->blocked_by, - ACTION_BOMBARD2); - BV_SET(action_by_number(ACTION_NUKE)->blocked_by, - ACTION_BOMBARD3); - BV_SET(action_by_number(ACTION_NUKE_CITY)->blocked_by, - ACTION_BOMBARD3); - BV_SET(action_by_number(ACTION_NUKE_UNITS)->blocked_by, - ACTION_BOMBARD3); - BV_SET(action_by_number(ACTION_SUICIDE_ATTACK)->blocked_by, - ACTION_BOMBARD3); - BV_SET(action_by_number(ACTION_ATTACK)->blocked_by, - ACTION_BOMBARD3); - BV_SET(action_by_number(ACTION_CONQUER_CITY)->blocked_by, - ACTION_BOMBARD3); - BV_SET(action_by_number(ACTION_CONQUER_CITY2)->blocked_by, - ACTION_BOMBARD3); - } - - /* Forbid attacking when it is legal to do explode nuclear. */ - force_explode_nuclear - = secfile_lookup_bool_default(file, - FALSE, - "actions.force_explode_nuclear"); - - if (force_explode_nuclear) { - BV_SET(action_by_number(ACTION_SUICIDE_ATTACK)->blocked_by, - ACTION_NUKE); - BV_SET(action_by_number(ACTION_ATTACK)->blocked_by, - ACTION_NUKE); - BV_SET(action_by_number(ACTION_CONQUER_CITY)->blocked_by, - ACTION_NUKE); - BV_SET(action_by_number(ACTION_CONQUER_CITY2)->blocked_by, - ACTION_NUKE); - BV_SET(action_by_number(ACTION_SUICIDE_ATTACK)->blocked_by, - ACTION_NUKE_CITY); - BV_SET(action_by_number(ACTION_ATTACK)->blocked_by, - ACTION_NUKE_CITY); - BV_SET(action_by_number(ACTION_CONQUER_CITY)->blocked_by, - ACTION_NUKE_CITY); - BV_SET(action_by_number(ACTION_CONQUER_CITY2)->blocked_by, - ACTION_NUKE_CITY); - BV_SET(action_by_number(ACTION_SUICIDE_ATTACK)->blocked_by, - ACTION_NUKE_UNITS); - BV_SET(action_by_number(ACTION_ATTACK)->blocked_by, - ACTION_NUKE_UNITS); - BV_SET(action_by_number(ACTION_CONQUER_CITY)->blocked_by, - ACTION_NUKE_UNITS); - BV_SET(action_by_number(ACTION_CONQUER_CITY2)->blocked_by, - ACTION_NUKE_UNITS); - } - } - action_iterate(act_id) { struct action *paction = action_by_number(act_id); if (!load_action_blocked_by_list(file, filename, paction)) { -- 2.20.1