From 397be1582593563fb0d5f2b8d785bd489c20f700 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Fri, 30 Jun 2023 17:51:47 +0300 Subject: [PATCH 14/14] Drop old "Clean Pollution/Fallout" actions and activities See osdn #48135 Signed-off-by: Marko Lindqvist --- ai/default/daicity.c | 6 +- ai/default/daidiplomacy.c | 4 +- client/helpdata.c | 2 - client/packhand.c | 2 - client/tilespec.c | 4 -- common/actions.c | 80 +++++---------------- common/actions.h | 20 ++++-- common/actres.c | 109 ++--------------------------- common/actres.h | 7 +- common/aicore/aiactions.c | 4 +- common/clientutils.c | 42 +---------- common/extras.c | 9 +-- common/fc_types.h | 43 +++++------- common/terrain.c | 2 - common/tile.c | 4 -- common/unit.c | 28 +------- common/unit.h | 2 +- data/alien/terrain.ruleset | 1 - data/civ1/terrain.ruleset | 1 - data/civ2/terrain.ruleset | 1 - data/civ2civ3/terrain.ruleset | 1 - data/classic/terrain.ruleset | 1 - data/goldkeep/terrain.ruleset | 1 - data/granularity/terrain.ruleset | 1 - data/multiplayer/terrain.ruleset | 1 - data/ruledit/comments-3.3.txt | 1 - data/sandbox/terrain.ruleset | 1 - data/stub/terrain.ruleset | 1 - data/webperimental/terrain.ruleset | 1 - doc/README.actions | 29 +------- server/advisors/advdata.c | 6 +- server/rssanity.c | 3 +- server/savegame/savecompat.c | 2 - server/savegame/savegame2.c | 42 ++++------- server/savegame/savegame3.c | 17 +++-- server/unithand.c | 4 -- server/unittools.c | 45 +----------- 37 files changed, 101 insertions(+), 427 deletions(-) diff --git a/ai/default/daicity.c b/ai/default/daicity.c index a7befd8b72..cda8f98f29 100644 --- a/ai/default/daicity.c +++ b/ai/default/daicity.c @@ -1291,8 +1291,6 @@ static int action_target_neg_util(action_id act_id, case ACTRES_PLANT: case ACTRES_PILLAGE: case ACTRES_CLEAN: - case ACTRES_CLEAN_POLLUTION: - case ACTRES_CLEAN_FALLOUT: case ACTRES_FORTIFY: case ACTRES_ROAD: case ACTRES_CONVERT: @@ -1312,8 +1310,12 @@ static int action_target_neg_util(action_id act_id, case ACTRES_TELEPORT: case ACTRES_HOMELESS: case ACTRES_ENABLER_CHECK: + + case ACTRES_UNUSED_1: + case ACTRES_UNUSED_2: fc_assert_msg(action_id_get_target_kind(act_id) == ATK_CITY, "Action not aimed at cities"); + break; } /* Wrong action. Ignore it. */ diff --git a/ai/default/daidiplomacy.c b/ai/default/daidiplomacy.c index 3736f0c6d6..d4803db406 100644 --- a/ai/default/daidiplomacy.c +++ b/ai/default/daidiplomacy.c @@ -2038,15 +2038,13 @@ void dai_incident(struct ai_type *ait, enum incident_type type, case ACTRES_HOMELESS: case ACTRES_UPGRADE_UNIT: case ACTRES_PARADROP: - case ACTRES_PARADROP_CONQUER: /* TODO: bigger incident */ + case ACTRES_PARADROP_CONQUER: /* TODO: Bigger incident */ case ACTRES_AIRLIFT: case ACTRES_HEAL_UNIT: case ACTRES_TRANSFORM_TERRAIN: case ACTRES_CULTIVATE: case ACTRES_PLANT: case ACTRES_CLEAN: - case ACTRES_CLEAN_POLLUTION: - case ACTRES_CLEAN_FALLOUT: case ACTRES_FORTIFY: case ACTRES_ROAD: case ACTRES_CONVERT: diff --git a/client/helpdata.c b/client/helpdata.c index 587afdb92c..1fb3b381e4 100644 --- a/client/helpdata.c +++ b/client/helpdata.c @@ -2832,8 +2832,6 @@ char *helptext_unit(char *buf, size_t bufsz, struct player *pplayer, } break; case ACTRES_CLEAN: - case ACTRES_CLEAN_POLLUTION: - case ACTRES_CLEAN_FALLOUT: { struct astring extras_and = ASTRING_INIT; struct strvec *extras_vec = strvec_new(); diff --git a/client/packhand.c b/client/packhand.c index c8f8262db7..234c3ba30c 100644 --- a/client/packhand.c +++ b/client/packhand.c @@ -199,8 +199,6 @@ const action_id auto_attack_blockers[] = { ACTION_PLANT, ACTION_PILLAGE, ACTION_CLEAN, - ACTION_CLEAN_POLLUTION, - ACTION_CLEAN_FALLOUT, ACTION_ROAD, ACTION_BASE, ACTION_MINE, diff --git a/client/tilespec.c b/client/tilespec.c index 9ac17ccc88..e5e8800c31 100644 --- a/client/tilespec.c +++ b/client/tilespec.c @@ -4609,8 +4609,6 @@ static int fill_unit_sprite_array(const struct tileset *t, s = t->sprites.unit.cultivate; break; case ACTIVITY_CLEAN: - case ACTIVITY_POLLUTION: - case ACTIVITY_FALLOUT: s = t->sprites.extras[extra_index(punit->activity_target)].rmact; break; case ACTIVITY_PILLAGE: @@ -6393,8 +6391,6 @@ int fill_sprite_array(struct tileset *t, FULL_TILE_Y_OFFSET + t->activity_offset_y); break; case ACTIVITY_CLEAN: - case ACTIVITY_POLLUTION: - case ACTIVITY_FALLOUT: if (ptask->tgt != NULL) { ADD_SPRITE(t->sprites.extras[extra_index(ptask->tgt)].rmact, TRUE, FULL_TILE_X_OFFSET + t->activity_offset_x, diff --git a/common/actions.c b/common/actions.c index b681ea5ae0..12b97fdbc5 100644 --- a/common/actions.c +++ b/common/actions.c @@ -523,8 +523,6 @@ static void hard_code_oblig_hard_reqs(void) ACTRES_MINE, ACTRES_IRRIGATE, ACTRES_CLEAN, - ACTRES_CLEAN_POLLUTION, - ACTRES_CLEAN_FALLOUT, ACTRES_NONE); /* Why this is a hard requirement: Preserve semantics of the rule that a @@ -1343,14 +1341,6 @@ static void hard_code_actions(void) unit_action_new(ACTION_CLEAN, ACTRES_CLEAN, TRUE, FALSE, MAK_STAYS, 0, 0, FALSE); - actions[ACTION_CLEAN_POLLUTION] = - unit_action_new(ACTION_CLEAN_POLLUTION, ACTRES_CLEAN_POLLUTION, - TRUE, FALSE, - MAK_STAYS, 0, 0, FALSE); - actions[ACTION_CLEAN_FALLOUT] = - unit_action_new(ACTION_CLEAN_FALLOUT, ACTRES_CLEAN_FALLOUT, - TRUE, FALSE, - MAK_STAYS, 0, 0, FALSE); actions[ACTION_FORTIFY] = unit_action_new(ACTION_FORTIFY, ACTRES_FORTIFY, TRUE, FALSE, @@ -1523,6 +1513,19 @@ static void hard_code_actions(void) MAK_UNREPRESENTABLE, /* Overwritten by the ruleset */ 0, 1, FALSE); + + /* The structure even for these need to be created, for + * the action_id_rule_name() to work on iterations. */ + actions[ACTION_UNUSED_1] + = unit_action_new(ACTION_UNUSED_1, ACTRES_NONE, + FALSE, FALSE, + MAK_UNREPRESENTABLE, + 0, 0, FALSE); + actions[ACTION_UNUSED_2] + = unit_action_new(ACTION_UNUSED_2, ACTRES_NONE, + FALSE, FALSE, + MAK_UNREPRESENTABLE, + 0, 0, FALSE); } /**********************************************************************//** @@ -2175,8 +2178,6 @@ int action_get_act_time(const struct action *paction, switch (pactivity) { case ACTIVITY_PILLAGE: case ACTIVITY_CLEAN: - case ACTIVITY_POLLUTION: - case ACTIVITY_FALLOUT: case ACTIVITY_BASE: case ACTIVITY_GEN_ROAD: case ACTIVITY_IRRIGATE: @@ -2273,8 +2274,6 @@ bool action_creates_extra(const struct action *paction, case ACTRES_PLANT: case ACTRES_PILLAGE: case ACTRES_CLEAN: - case ACTRES_CLEAN_POLLUTION: - case ACTRES_CLEAN_FALLOUT: case ACTRES_FORTIFY: case ACTRES_CONVERT: case ACTRES_TRANSPORT_DEBOARD: @@ -2314,13 +2313,7 @@ bool action_removes_extra(const struct action *paction, case ACTRES_PILLAGE: return is_extra_removed_by(pextra, ERM_PILLAGE); case ACTRES_CLEAN: - return is_extra_removed_by(pextra, ERM_CLEAN) - || is_extra_removed_by(pextra, ERM_CLEANPOLLUTION) - || is_extra_removed_by(pextra, ERM_CLEANFALLOUT); - case ACTRES_CLEAN_POLLUTION: - return is_extra_removed_by(pextra, ERM_CLEANPOLLUTION); - case ACTRES_CLEAN_FALLOUT: - return is_extra_removed_by(pextra, ERM_CLEANFALLOUT); + return is_extra_removed_by(pextra, ERM_CLEAN); case ACTRES_HUT_ENTER: case ACTRES_HUT_FRIGHTEN: return is_extra_removed_by(pextra, ERM_ENTER); @@ -3475,8 +3468,6 @@ action_actor_utype_hard_reqs_ok_full(const struct action *paction, case ACTRES_HEAL_UNIT: case ACTRES_PILLAGE: case ACTRES_CLEAN: - case ACTRES_CLEAN_POLLUTION: - case ACTRES_CLEAN_FALLOUT: case ACTRES_FORTIFY: case ACTRES_TRANSFORM_TERRAIN: case ACTRES_CULTIVATE: @@ -3673,8 +3664,6 @@ action_hard_reqs_actor(const struct action *paction, case ACTRES_PLANT: case ACTRES_PILLAGE: case ACTRES_CLEAN: - case ACTRES_CLEAN_POLLUTION: - case ACTRES_CLEAN_FALLOUT: case ACTRES_FORTIFY: case ACTRES_ROAD: case ACTRES_BASE: @@ -4959,8 +4948,6 @@ action_prob(const action_id wanted_action, case ACTRES_PLANT: case ACTRES_PILLAGE: case ACTRES_CLEAN: - case ACTRES_CLEAN_POLLUTION: - case ACTRES_CLEAN_FALLOUT: case ACTRES_FORTIFY: case ACTRES_ROAD: case ACTRES_CONVERT: @@ -5009,7 +4996,10 @@ action_prob(const action_id wanted_action, chance = ACTPROB_NOT_IMPLEMENTED; break; - ASSERT_UNUSED_ACTRES_CASES; + case ACTRES_UNUSED_1: + case ACTRES_UNUSED_2: + chance = ACTPROB_NOT_IMPLEMENTED; + break; } /* Non signal action probabilities should be in range. */ @@ -6806,10 +6796,6 @@ const char *action_ui_name_ruleset_var_name(int act) return "ui_name_pillage"; case ACTION_CLEAN: return "ui_name_clean"; - case ACTION_CLEAN_POLLUTION: - return "ui_name_clean_pollution"; - case ACTION_CLEAN_FALLOUT: - return "ui_name_clean_fallout"; case ACTION_FORTIFY: return "ui_name_fortify"; case ACTION_ROAD: @@ -7126,12 +7112,6 @@ const char *action_ui_name_default(int act) case ACTION_CLEAN: /* TRANS: Clean (100% chance of success). */ return N_("%sClean%s"); - case ACTION_CLEAN_POLLUTION: - /* TRANS: Clean _Pollution (100% chance of success). */ - return N_("Clean %sPollution%s"); - case ACTION_CLEAN_FALLOUT: - /* TRANS: Clean _Fallout (100% chance of success). */ - return N_("Clean %sFallout%s"); case ACTION_FORTIFY: /* TRANS: _Fortify (100% chance of success). */ return N_("%sFortify%s"); @@ -7230,7 +7210,7 @@ const char *action_ui_name_default(int act) Return min range ruleset variable name for the action or NULL if min range can't be set in the ruleset. - TODO: make actions generic and put min_range in a field of the action. + TODO: Make actions generic and put min_range in a field of the action. **************************************************************************/ const char *action_min_range_ruleset_var_name(int act) { @@ -7299,8 +7279,6 @@ const char *action_min_range_ruleset_var_name(int act) case ACTION_PLANT: case ACTION_PILLAGE: case ACTION_CLEAN: - case ACTION_CLEAN_POLLUTION: - case ACTION_CLEAN_FALLOUT: case ACTION_FORTIFY: case ACTION_ROAD: case ACTION_CONVERT: @@ -7422,8 +7400,6 @@ int action_min_range_default(enum action_result result) case ACTRES_PLANT: case ACTRES_PILLAGE: case ACTRES_CLEAN: - case ACTRES_CLEAN_POLLUTION: - case ACTRES_CLEAN_FALLOUT: case ACTRES_FORTIFY: case ACTRES_ROAD: case ACTRES_CONVERT: @@ -7533,8 +7509,6 @@ const char *action_max_range_ruleset_var_name(int act) case ACTION_PLANT: case ACTION_PILLAGE: case ACTION_CLEAN: - case ACTION_CLEAN_POLLUTION: - case ACTION_CLEAN_FALLOUT: case ACTION_FORTIFY: case ACTION_ROAD: case ACTION_CONVERT: @@ -7662,8 +7636,6 @@ int action_max_range_default(enum action_result result) case ACTRES_PLANT: case ACTRES_PILLAGE: case ACTRES_CLEAN: - case ACTRES_CLEAN_POLLUTION: - case ACTRES_CLEAN_FALLOUT: case ACTRES_FORTIFY: case ACTRES_ROAD: case ACTRES_CONVERT: @@ -7783,8 +7755,6 @@ const char *action_target_kind_ruleset_var_name(int act) case ACTION_CULTIVATE: case ACTION_PLANT: case ACTION_CLEAN: - case ACTION_CLEAN_POLLUTION: - case ACTION_CLEAN_FALLOUT: case ACTION_FORTIFY: case ACTION_ROAD: case ACTION_CONVERT: @@ -7920,8 +7890,6 @@ action_target_kind_default(enum action_result result) case ACTRES_PLANT: case ACTRES_PILLAGE: case ACTRES_CLEAN: - case ACTRES_CLEAN_POLLUTION: - case ACTRES_CLEAN_FALLOUT: case ACTRES_ROAD: case ACTRES_BASE: case ACTRES_MINE: @@ -8014,8 +7982,6 @@ bool action_result_legal_target_kind(enum action_result result, case ACTRES_CULTIVATE: case ACTRES_PLANT: case ACTRES_CLEAN: - case ACTRES_CLEAN_POLLUTION: - case ACTRES_CLEAN_FALLOUT: case ACTRES_ROAD: case ACTRES_BASE: case ACTRES_MINE: @@ -8134,8 +8100,6 @@ action_sub_target_kind_default(enum action_result result) return ASTK_NONE; case ACTRES_PILLAGE: case ACTRES_CLEAN: - case ACTRES_CLEAN_POLLUTION: - case ACTRES_CLEAN_FALLOUT: return ASTK_EXTRA; case ACTRES_ROAD: case ACTRES_BASE: @@ -8230,8 +8194,6 @@ const char *action_actor_consuming_always_ruleset_var_name(action_id act) case ACTION_PLANT: case ACTION_PILLAGE: case ACTION_CLEAN: - case ACTION_CLEAN_POLLUTION: - case ACTION_CLEAN_FALLOUT: case ACTION_FORTIFY: case ACTION_ROAD: case ACTION_CONVERT: @@ -8414,8 +8376,6 @@ const char *action_blocked_by_ruleset_var_name(const struct action *act) case ACTION_PLANT: case ACTION_PILLAGE: case ACTION_CLEAN: - case ACTION_CLEAN_POLLUTION: - case ACTION_CLEAN_FALLOUT: case ACTION_FORTIFY: case ACTION_ROAD: case ACTION_CONVERT: @@ -8559,8 +8519,6 @@ action_post_success_forced_ruleset_var_name(const struct action *act) case ACTION_PLANT: case ACTION_PILLAGE: case ACTION_CLEAN: - case ACTION_CLEAN_POLLUTION: - case ACTION_CLEAN_FALLOUT: case ACTION_FORTIFY: case ACTION_ROAD: case ACTION_CONVERT: diff --git a/common/actions.h b/common/actions.h index 1b8699418c..6bf524e027 100644 --- a/common/actions.h +++ b/common/actions.h @@ -35,7 +35,12 @@ extern "C" { * break; */ #define ASSERT_UNUSED_ACTION_CASES \ - /* No unused actions at the moment */ + case ACTION_UNUSED_1: \ + fc_assert_msg(FALSE, "ACTION_UNUSED_1"); \ + break; \ + case ACTION_UNUSED_2: \ + fc_assert_msg(FALSE, "ACTION_UNUSED_2"); \ + break; #define SPECENUM_NAME action_actor_kind #define SPECENUM_VALUE0 AAK_UNIT @@ -180,10 +185,11 @@ const char *gen_action_name_update_cb(const char *old_name); #define SPECENUM_VALUE64NAME "Build Base" #define SPECENUM_VALUE65 ACTION_PILLAGE #define SPECENUM_VALUE65NAME "Pillage" -#define SPECENUM_VALUE66 ACTION_CLEAN_POLLUTION -#define SPECENUM_VALUE66NAME "Clean Pollution" -#define SPECENUM_VALUE67 ACTION_CLEAN_FALLOUT -#define SPECENUM_VALUE67NAME "Clean Fallout" +/* TODO: Rearrange actions to get rid of these */ +#define SPECENUM_VALUE66 ACTION_UNUSED_1 +#define SPECENUM_VALUE66NAME "Unused1" +#define SPECENUM_VALUE67 ACTION_UNUSED_2 +#define SPECENUM_VALUE67NAME "Unused2" #define SPECENUM_VALUE68 ACTION_TRANSPORT_BOARD #define SPECENUM_VALUE68NAME "Transport Board" #define SPECENUM_VALUE69 ACTION_TRANSPORT_BOARD2 @@ -441,9 +447,11 @@ struct action_enabler #define action_iterate(_act_) \ { \ action_id _act_; \ - for (_act_ = 0; _act_ < NUM_ACTIONS; _act_++) { + for (_act_ = 0; _act_ < NUM_ACTIONS; _act_++) { \ + if (_act_ != ACTION_UNUSED_1 && _act_ != ACTION_UNUSED_2) { #define action_iterate_end \ + } \ } \ } diff --git a/common/actres.c b/common/actres.c index 13f5404aab..7e1a15a2a5 100644 --- a/common/actres.c +++ b/common/actres.c @@ -123,10 +123,10 @@ static struct actres act_results[ACTRES_LAST] = { FALSE, ACTIVITY_MINE, DRT_NONE }, { ACT_TGT_COMPL_MANDATORY, ABK_NONE, /* ACTRES_IRRIGATE */ FALSE, ACTIVITY_IRRIGATE, DRT_NONE }, - { ACT_TGT_COMPL_FLEXIBLE, ABK_NONE, /* ACTRES_CLEAN_POLLUTION */ - FALSE, ACTIVITY_POLLUTION, DRT_NONE }, - { ACT_TGT_COMPL_FLEXIBLE, ABK_NONE, /* ACTRES_CLEAN_FALLOUT */ - FALSE, ACTIVITY_FALLOUT, DRT_NONE }, + { ACT_TGT_COMPL_FLEXIBLE, ABK_NONE, /* ACTRES_UNUSED_1 */ + FALSE, ACTIVITY_LAST, DRT_NONE }, + { ACT_TGT_COMPL_FLEXIBLE, ABK_NONE, /* ACTRES_UNUSED_2 */ + FALSE, ACTIVITY_LAST, DRT_NONE }, { ACT_TGT_COMPL_SIMPLE, ABK_NONE, /* ACTRES_TRANSPORT_DEBOARD */ FALSE, ACTIVITY_LAST, DRT_NONE }, { ACT_TGT_COMPL_SIMPLE, ABK_NONE, /* ACTRES_TRANSPORT_UNLOAD */ @@ -764,33 +764,16 @@ enum fc_tristate actres_possible(enum action_result result, if (target_extra != NULL) { if (tile_has_extra(target->tile, target_extra) - && (is_extra_removed_by(target_extra, ERM_CLEAN) - || is_extra_removed_by(target_extra, ERM_CLEANPOLLUTION) - || is_extra_removed_by(target_extra, ERM_CLEANFALLOUT))) { + && (is_extra_removed_by(target_extra, ERM_CLEAN))) { pextra = target_extra; } } else { /* TODO: Make sure that all callers set target so that * we don't need this fallback. */ - pextra = prev_extra_in_tile(target->tile, ERM_CLEAN, actor->player, actor->unit); - - if (pextra == NULL) { - pextra = prev_extra_in_tile(target->tile, - ERM_CLEANPOLLUTION, - actor->player, - actor->unit); - - if (pextra == NULL) { - pextra = prev_extra_in_tile(target->tile, - ERM_CLEANFALLOUT, - actor->player, - actor->unit); - } - } } if (pextra != NULL && pterrain->extra_removal_times[extra_index(pextra)] > 0 @@ -801,88 +784,6 @@ enum fc_tristate actres_possible(enum action_result result, return TRI_NO; } - case ACTRES_CLEAN_POLLUTION: - { - const struct extra_type *pextra; - - pterrain = tile_terrain(target->tile); - - if (target_extra != NULL) { - pextra = target_extra; - - if (!is_extra_removed_by(pextra, ERM_CLEANPOLLUTION)) { - return TRI_NO; - } - - if (!tile_has_extra(target->tile, pextra)) { - return TRI_NO; - } - } else { - /* TODO: Make sure that all callers set target so that - * we don't need this fallback. */ - pextra = prev_extra_in_tile(target->tile, - ERM_CLEANPOLLUTION, - actor->player, - actor->unit); - if (pextra == NULL) { - /* No available pollution extras */ - return TRI_NO; - } - } - - if (pterrain->extra_removal_times[extra_index(pextra)] == 0) { - return TRI_NO; - } - - if (can_remove_extra(pextra, actor->unit, target->tile)) { - return TRI_YES; - } - - return TRI_NO; - } - break; - - case ACTRES_CLEAN_FALLOUT: - { - const struct extra_type *pextra; - - pterrain = tile_terrain(target->tile); - - if (target_extra != NULL) { - pextra = target_extra; - - if (!is_extra_removed_by(pextra, ERM_CLEANFALLOUT)) { - return TRI_NO; - } - - if (!tile_has_extra(target->tile, pextra)) { - return TRI_NO; - } - } else { - /* TODO: Make sure that all callers set target so that - * we don't need this fallback. */ - pextra = prev_extra_in_tile(target->tile, - ERM_CLEANFALLOUT, - actor->player, - actor->unit); - if (pextra == NULL) { - /* No available fallout extras */ - return TRI_NO; - } - } - - if (pterrain->extra_removal_times[extra_index(pextra)] == 0) { - return TRI_NO; - } - - if (can_remove_extra(pextra, actor->unit, target->tile)) { - return TRI_YES; - } - - return TRI_NO; - } - break; - case ACTRES_TRANSPORT_DEBOARD: if (!can_unit_unload(actor->unit, target->unit)) { /* Keep the old rules about Unreachable and disembarks. */ diff --git a/common/actres.h b/common/actres.h index c6f5933d47..77499230c8 100644 --- a/common/actres.h +++ b/common/actres.h @@ -34,7 +34,12 @@ struct req_context; * break; */ #define ASSERT_UNUSED_ACTRES_CASES \ - /* No unused action results at the moment */ + case ACTRES_UNUSED_1: \ + fc_assert_msg(FALSE, "ACTRES_UNUSED_1"); \ + break; \ + case ACTRES_UNUSED_2: \ + fc_assert_msg(FALSE, "ACTRES_UNUSED_2"); \ + break; /* When making changes to this, update also atk_helpnames at actions.c */ #define SPECENUM_NAME action_target_kind diff --git a/common/aicore/aiactions.c b/common/aicore/aiactions.c index 8d18f89fd3..a0e64ebe17 100644 --- a/common/aicore/aiactions.c +++ b/common/aicore/aiactions.c @@ -95,7 +95,5 @@ bool aia_utype_is_considered_worker(const struct unit_type *putype) || utype_can_do_action_result(putype, ACTRES_BASE) || utype_can_do_action_result(putype, ACTRES_MINE) || utype_can_do_action_result(putype, ACTRES_IRRIGATE) - || utype_can_do_action_result(putype, ACTRES_CLEAN) - || utype_can_do_action_result(putype, ACTRES_CLEAN_POLLUTION) - || utype_can_do_action_result(putype, ACTRES_CLEAN_FALLOUT)); + || utype_can_do_action_result(putype, ACTRES_CLEAN)); } diff --git a/common/clientutils.c b/common/clientutils.c index 7b9c62f479..5bf3810749 100644 --- a/common/clientutils.c +++ b/common/clientutils.c @@ -266,13 +266,7 @@ const char *concat_tile_activity_text(struct tile *ptile) rmcause = ERM_PILLAGE; break; case ACTIVITY_CLEAN: - rmcause = ERM_CLEAN; /* Also ERM_CLEANPOLLUTION and ERM_CLEANFALLOUT */ - break; - case ACTIVITY_POLLUTION: - rmcause = ERM_CLEANPOLLUTION; - break; - case ACTIVITY_FALLOUT: - rmcause = ERM_CLEANFALLOUT; + rmcause = ERM_CLEAN; break; default: fc_assert(rmcause != ERM_NONE); @@ -295,40 +289,6 @@ const char *concat_tile_activity_text(struct tile *ptile) } } extra_type_by_rmcause_iterate_end; } - - if (i == ACTIVITY_CLEAN) { - extra_type_by_rmcause_iterate(ERM_CLEANPOLLUTION, ep) { - /* Make sure it's not handled by earlier iteration already */ - if (!is_extra_caused_by(ep, ERM_CLEAN)) { - int ei = extra_index(ep); - - if (calc->rmextra_turns[ei][i] > 0) { - if (num_activities > 0) { - astr_add(&str, "/"); - } - astr_add(&str, _("Clean %s(%d)"), - extra_name_translation(ep), calc->rmextra_turns[ei][i]); - num_activities++; - } - } - } extra_type_by_rmcause_iterate_end; - extra_type_by_rmcause_iterate(ERM_CLEANFALLOUT, ep) { - /* Make sure it's not handled by earlier iterations already */ - if (!is_extra_caused_by(ep, ERM_CLEAN) - && !is_extra_caused_by(ep, ERM_CLEANPOLLUTION)) { - int ei = extra_index(ep); - - if (calc->rmextra_turns[ei][i] > 0) { - if (num_activities > 0) { - astr_add(&str, "/"); - } - astr_add(&str, _("Clean %s(%d)"), - extra_name_translation(ep), calc->rmextra_turns[ei][i]); - num_activities++; - } - } - } extra_type_by_rmcause_iterate_end; - } } else if (is_tile_activity(i)) { if (calc->activity_turns[i] > 0) { if (num_activities > 0) { diff --git a/common/extras.c b/common/extras.c index 90e369cee6..96463e8f37 100644 --- a/common/extras.c +++ b/common/extras.c @@ -318,8 +318,7 @@ void _extra_to_removed_by_list(struct extra_type *pextra, { extra_type_list_append(removed_by[rmcause], pextra); - if (rmcause == ERM_CLEAN - || rmcause == ERM_CLEANPOLLUTION || rmcause == ERM_CLEANFALLOUT) { + if (rmcause == ERM_CLEAN) { extra_type_list_append(cleanable, pextra); } } @@ -1020,8 +1019,6 @@ bool is_extra_removed_by_worker_action(const struct extra_type *pextra) /* Is any of the worker remove action bits set? */ return (pextra->rmcauses & (1 << ERM_CLEAN - | 1 << ERM_CLEANPOLLUTION - | 1 << ERM_CLEANFALLOUT | 1 << ERM_PILLAGE)); } @@ -1076,10 +1073,6 @@ enum extra_rmcause activity_to_extra_rmcause(enum unit_activity act) return ERM_CLEAN; case ACTIVITY_PILLAGE: return ERM_PILLAGE; - case ACTIVITY_POLLUTION: - return ERM_CLEANPOLLUTION; - case ACTIVITY_FALLOUT: - return ERM_CLEANFALLOUT; default: break; } diff --git a/common/fc_types.h b/common/fc_types.h index 31d71745d3..a3296c911e 100644 --- a/common/fc_types.h +++ b/common/fc_types.h @@ -133,10 +133,10 @@ enum counter_target { CTGT_CITY }; /* Not performing any activity right now */ #define SPECENUM_VALUE0 ACTIVITY_IDLE #define SPECENUM_VALUE0NAME N_("Idle") -/* Action with the result ACTRES_CLEAN_POLLUTION */ -#define SPECENUM_VALUE1 ACTIVITY_POLLUTION -#define SPECENUM_VALUE1NAME N_("Pollution") /* Action with the result ACTRES_CULTIVATE */ +#define SPECENUM_VALUE1 ACTIVITY_CULTIVATE +#define SPECENUM_VALUE1NAME N_("Cultivate") +/* Action with the result ACTRES_MINE */ #define SPECENUM_VALUE2 ACTIVITY_MINE #define SPECENUM_VALUE2NAME N_("?act:Mine") /* Action with the result ACTRES_IRRIGATE */ @@ -163,9 +163,9 @@ enum counter_target { CTGT_CITY }; /* Action with the result ACTRES_FORTIFY */ #define SPECENUM_VALUE10 ACTIVITY_FORTIFYING #define SPECENUM_VALUE10NAME N_("Fortifying") -/* Action with the result ACTRES_CLEAN_FALLOUT */ -#define SPECENUM_VALUE11 ACTIVITY_FALLOUT -#define SPECENUM_VALUE11NAME N_("Fallout") +/* Action with the result ACTRES_CLEAN */ +#define SPECENUM_VALUE11 ACTIVITY_CLEAN +#define SPECENUM_VALUE11NAME N_("Clean") /* Action with the result ACTRES_BASE */ #define SPECENUM_VALUE12 ACTIVITY_BASE #define SPECENUM_VALUE12NAME N_("Base") @@ -175,15 +175,9 @@ enum counter_target { CTGT_CITY }; /* Action with the result ACTRES_CONVERT */ #define SPECENUM_VALUE14 ACTIVITY_CONVERT #define SPECENUM_VALUE14NAME N_("Convert") -/* Action with the result ACTRES_CULTIVATE */ -#define SPECENUM_VALUE15 ACTIVITY_CULTIVATE -#define SPECENUM_VALUE15NAME N_("Cultivate") /* Action with the result ACTRES_PLANT */ -#define SPECENUM_VALUE16 ACTIVITY_PLANT -#define SPECENUM_VALUE16NAME N_("Plant") -/* Action with the result ACTRES_CLEAN */ -#define SPECENUM_VALUE17 ACTIVITY_CLEAN -#define SPECENUM_VALUE17NAME N_("Clean") +#define SPECENUM_VALUE15 ACTIVITY_PLANT +#define SPECENUM_VALUE15NAME N_("Plant") /* Number of activities */ #define SPECENUM_COUNT ACTIVITY_LAST #include "specenum_gen.h" @@ -283,10 +277,11 @@ enum counter_target { CTGT_CITY }; #define SPECENUM_VALUE44NAME "Unit Build Mine" #define SPECENUM_VALUE45 ACTRES_IRRIGATE #define SPECENUM_VALUE45NAME "Unit Build Irrigation" -#define SPECENUM_VALUE46 ACTRES_CLEAN_POLLUTION -#define SPECENUM_VALUE46NAME "Unit Clean Pollution" -#define SPECENUM_VALUE47 ACTRES_CLEAN_FALLOUT -#define SPECENUM_VALUE47NAME "Unit Clean Fallout" +/* TODO: Rearrange action results to get rid of these */ +#define SPECENUM_VALUE46 ACTRES_UNUSED_1 +#define SPECENUM_VALUE46NAME "Unused1" +#define SPECENUM_VALUE47 ACTRES_UNUSED_2 +#define SPECENUM_VALUE47NAME "Unused2" #define SPECENUM_VALUE48 ACTRES_TRANSPORT_DEBOARD #define SPECENUM_VALUE48NAME "Unit Transport Deboard" #define SPECENUM_VALUE49 ACTRES_TRANSPORT_UNLOAD @@ -1098,14 +1093,10 @@ FC_STATIC_ASSERT(EC_COUNT < 16, extra_causes_over_limit); #define SPECENUM_VALUE0NAME "Pillage" #define SPECENUM_VALUE1 ERM_CLEAN #define SPECENUM_VALUE1NAME "Clean" -#define SPECENUM_VALUE2 ERM_CLEANFALLOUT -#define SPECENUM_VALUE2NAME "CleanFallout" -#define SPECENUM_VALUE3 ERM_DISAPPEARANCE -#define SPECENUM_VALUE3NAME "Disappear" -#define SPECENUM_VALUE4 ERM_ENTER -#define SPECENUM_VALUE4NAME "Enter" -#define SPECENUM_VALUE5 ERM_CLEANPOLLUTION -#define SPECENUM_VALUE5NAME "CleanPollution" +#define SPECENUM_VALUE2 ERM_DISAPPEARANCE +#define SPECENUM_VALUE2NAME "Disappear" +#define SPECENUM_VALUE3 ERM_ENTER +#define SPECENUM_VALUE3NAME "Enter" #define SPECENUM_COUNT ERM_COUNT #define SPECENUM_BITVECTOR bv_rmcauses #include "specenum_gen.h" diff --git a/common/terrain.c b/common/terrain.c index 5cdb19ee64..841e6566bb 100644 --- a/common/terrain.c +++ b/common/terrain.c @@ -760,8 +760,6 @@ int terrain_extra_removal_time(const struct terrain *pterrain, /* Terrain and activity specific removal time */ switch (activity) { case ACTIVITY_CLEAN: - case ACTIVITY_POLLUTION: - case ACTIVITY_FALLOUT: return pterrain->extra_removal_times[extra_index(tgt)] * factor; case ACTIVITY_PILLAGE: return pterrain->pillage_time * factor; diff --git a/common/tile.c b/common/tile.c index e96c47f212..629dc8edc7 100644 --- a/common/tile.c +++ b/common/tile.c @@ -435,8 +435,6 @@ int tile_activity_time(enum unit_activity activity, const struct tile *ptile, switch (activity) { case ACTIVITY_CLEAN: - case ACTIVITY_POLLUTION: - case ACTIVITY_FALLOUT: case ACTIVITY_PILLAGE: return terrain_extra_removal_time(pterrain, activity, tgt) * ACTIVITY_FACTOR; case ACTIVITY_TRANSFORM: @@ -710,8 +708,6 @@ bool tile_apply_activity(struct tile *ptile, Activity_type_id act, case ACTIVITY_BASE: case ACTIVITY_GEN_ROAD: case ACTIVITY_CLEAN: - case ACTIVITY_POLLUTION: - case ACTIVITY_FALLOUT: /* Do nothing - not implemented */ return FALSE; diff --git a/common/unit.c b/common/unit.c index 8c0aacff66..7f2fc56846 100644 --- a/common/unit.c +++ b/common/unit.c @@ -44,7 +44,7 @@ const Activity_type_id tile_changing_activities[] = { ACTIVITY_PILLAGE, ACTIVITY_GEN_ROAD, ACTIVITY_IRRIGATE, ACTIVITY_MINE, ACTIVITY_BASE, ACTIVITY_CULTIVATE, ACTIVITY_PLANT, ACTIVITY_TRANSFORM, - ACTIVITY_CLEAN, ACTIVITY_POLLUTION, ACTIVITY_FALLOUT, ACTIVITY_LAST }; + ACTIVITY_CLEAN, ACTIVITY_LAST }; struct cargo_iter { struct iterator vtable; @@ -564,8 +564,6 @@ bool activity_requires_target(enum unit_activity activity) case ACTIVITY_IRRIGATE: case ACTIVITY_MINE: case ACTIVITY_CLEAN: - case ACTIVITY_POLLUTION: - case ACTIVITY_FALLOUT: return TRUE; case ACTIVITY_IDLE: case ACTIVITY_FORTIFIED: @@ -615,8 +613,6 @@ const char *get_activity_text(enum unit_activity activity) return _("Idle"); case ACTIVITY_CLEAN: return _("Clean"); - case ACTIVITY_POLLUTION: - return _("Pollution"); case ACTIVITY_MINE: /* TRANS: Activity name, verb in English */ return Q_("?act:Mine"); @@ -641,8 +637,6 @@ const char *get_activity_text(enum unit_activity activity) return _("Explore"); case ACTIVITY_TRANSFORM: return _("Transform"); - case ACTIVITY_FALLOUT: - return _("Fallout"); case ACTIVITY_BASE: return _("Base"); case ACTIVITY_GEN_ROAD: @@ -967,20 +961,6 @@ bool can_unit_do_activity_targeted_at(const struct unit *punit, return is_action_enabled_unit_on_tile(ACTION_CLEAN, punit, ptile, target); - case ACTIVITY_POLLUTION: - /* The call below doesn't support actor tile speculation. */ - fc_assert_msg(unit_tile(punit) == ptile, - "Please use action_speculate_unit_on_tile()"); - return is_action_enabled_unit_on_tile(ACTION_CLEAN_POLLUTION, - punit, ptile, target); - - case ACTIVITY_FALLOUT: - /* The call below doesn't support actor tile speculation. */ - fc_assert_msg(unit_tile(punit) == ptile, - "Please use action_speculate_unit_on_tile()"); - return is_action_enabled_unit_on_tile(ACTION_CLEAN_FALLOUT, - punit, ptile, target); - case ACTIVITY_MINE: /* The call below doesn't support actor tile speculation. */ fc_assert_msg(unit_tile(punit) == ptile, @@ -1184,8 +1164,6 @@ void unit_activity_astr(const struct unit *punit, struct astring *astr) } return; case ACTIVITY_CLEAN: - case ACTIVITY_POLLUTION: - case ACTIVITY_FALLOUT: case ACTIVITY_TRANSFORM: case ACTIVITY_FORTIFYING: case ACTIVITY_FORTIFIED: @@ -1519,8 +1497,6 @@ bool is_clean_activity(enum unit_activity activity) switch (activity) { case ACTIVITY_PILLAGE: case ACTIVITY_CLEAN: - case ACTIVITY_POLLUTION: - case ACTIVITY_FALLOUT: return TRUE; default: return FALSE; @@ -2576,8 +2552,6 @@ bool unit_order_list_is_sane(int length, const struct unit_order *orders) case ACTIVITY_BASE: case ACTIVITY_GEN_ROAD: case ACTIVITY_CLEAN: - case ACTIVITY_POLLUTION: - case ACTIVITY_FALLOUT: case ACTIVITY_PILLAGE: case ACTIVITY_MINE: case ACTIVITY_IRRIGATE: diff --git a/common/unit.h b/common/unit.h index 84013cbe15..fb8c557fc1 100644 --- a/common/unit.h +++ b/common/unit.h @@ -296,7 +296,7 @@ extern const Activity_type_id tile_changing_activities[]; #define tile_changing_activities_iterate_end \ activity_type_list_iterate_end \ } - + bool are_unit_orders_equal(const struct unit_order *order1, const struct unit_order *order2); diff --git a/data/alien/terrain.ruleset b/data/alien/terrain.ruleset index a64a855a21..a29674dd58 100644 --- a/data/alien/terrain.ruleset +++ b/data/alien/terrain.ruleset @@ -693,7 +693,6 @@ ui_name_base_airbase = _("?gui_type:Build Airforce base") ; [resource_*] / [base_*] / [road_*] section) ; rmcauses = events that can remove extra type. ; "Clean", "Pillage", "Disappear", or "Enter" -; For now also "CleanPollution", "CleanFallout" ; infracost = Number of infrapoints it costs to place this ; extra. 0, the default, means extra cannot be placed. ; graphic = tag specifying preferred graphic diff --git a/data/civ1/terrain.ruleset b/data/civ1/terrain.ruleset index 73920b3266..051d53f38b 100644 --- a/data/civ1/terrain.ruleset +++ b/data/civ1/terrain.ruleset @@ -860,7 +860,6 @@ ui_name_base_airbase = _("?gui_type:Build None") ; [resource_*] / [base_*] / [road_*] section) ; rmcauses = events that can remove extra type. ; "Clean", "Pillage", "Disappear", or "Enter" -; For now also "CleanPollution", "CleanFallout" ; infracost = Number of infrapoints it costs to place this ; extra. 0, the default, means extra cannot be placed. ; graphic = tag specifying preferred graphic diff --git a/data/civ2/terrain.ruleset b/data/civ2/terrain.ruleset index a1b9280056..fff69ff177 100644 --- a/data/civ2/terrain.ruleset +++ b/data/civ2/terrain.ruleset @@ -931,7 +931,6 @@ ui_name_base_airbase = _("?gui_type:Build Airforce base") ; [resource_*] / [base_*] / [road_*] section) ; rmcauses = events that can remove extra type. ; "Clean", "Pillage", "Disappear", or "Enter" -; For now also "CleanPollution", "CleanFallout" ; infracost = Number of infrapoints it costs to place this ; extra. 0, the default, means extra cannot be placed. ; graphic = tag specifying preferred graphic diff --git a/data/civ2civ3/terrain.ruleset b/data/civ2civ3/terrain.ruleset index 99a04b1c82..d6ea3f1fcf 100644 --- a/data/civ2civ3/terrain.ruleset +++ b/data/civ2civ3/terrain.ruleset @@ -1136,7 +1136,6 @@ ui_name_base_airbase = _("?gui_type:Build Airstrip/Airbase") ; [resource_*] / [base_*] / [road_*] section) ; rmcauses = events that can remove extra type. ; "Clean", "Pillage", "Disappear", or "Enter" -; For now also "CleanPollution", "CleanFallout" ; infracost = Number of infrapoints it costs to place this ; extra. 0, the default, means extra cannot be placed. ; graphic = tag specifying preferred graphic diff --git a/data/classic/terrain.ruleset b/data/classic/terrain.ruleset index d843f09a4b..ab977a75e9 100644 --- a/data/classic/terrain.ruleset +++ b/data/classic/terrain.ruleset @@ -1115,7 +1115,6 @@ ui_name_base_airbase = _("?gui_type:Build Airbase") ; [resource_*] / [base_*] / [road_*] section) ; rmcauses = events that can remove extra type. ; "Clean", "Pillage", "Disappear", or "Enter" -; For now also "CleanPollution", "CleanFallout" ; infracost = Number of infrapoints it costs to place this ; extra. 0, the default, means extra cannot be placed. ; graphic = tag specifying preferred graphic diff --git a/data/goldkeep/terrain.ruleset b/data/goldkeep/terrain.ruleset index 2dddc1455d..16c87433b7 100644 --- a/data/goldkeep/terrain.ruleset +++ b/data/goldkeep/terrain.ruleset @@ -1091,7 +1091,6 @@ ui_name_base_airbase = _("?gui_type:Build Airbase") ; [resource_*] / [base_*] / [road_*] section) ; rmcauses = events that can remove extra type. ; "Clean", "Pillage", "Disappear", or "Enter" -; For now also "CleanPollution", "CleanFallout" ; infracost = Number of infrapoints it costs to place this ; extra. 0, the default, means extra cannot be placed. ; graphic = tag specifying preferred graphic diff --git a/data/granularity/terrain.ruleset b/data/granularity/terrain.ruleset index 36e87803c8..c270acfba0 100644 --- a/data/granularity/terrain.ruleset +++ b/data/granularity/terrain.ruleset @@ -464,7 +464,6 @@ ui_name_base_airbase = _("?gui_type:Build Type B Base") ; [resource_*] / [base_*] / [road_*] section) ; rmcauses = events that can remove extra type. ; "Clean", "Pillage", "Disappear", or "Enter" -; For now also "CleanPollution", "CleanFallout" ; infracost = Number of infrapoints it costs to place this ; extra. 0, the default, means extra cannot be placed. ; graphic = tag specifying preferred graphic diff --git a/data/multiplayer/terrain.ruleset b/data/multiplayer/terrain.ruleset index f1bd0ad2a3..c71df034fc 100644 --- a/data/multiplayer/terrain.ruleset +++ b/data/multiplayer/terrain.ruleset @@ -1089,7 +1089,6 @@ ui_name_base_airbase = _("?gui_type:Build Airbase") ; [resource_*] / [base_*] / [road_*] section) ; rmcauses = events that can remove extra type. ; "Clean", "Pillage", "Disappear", or "Enter" -; For now also "CleanPollution", "CleanFallout" ; infracost = Number of infrapoints it costs to place this ; extra. 0, the default, means extra cannot be placed. ; graphic = tag specifying preferred graphic diff --git a/data/ruledit/comments-3.3.txt b/data/ruledit/comments-3.3.txt index 63f26838bc..d168559faf 100644 --- a/data/ruledit/comments-3.3.txt +++ b/data/ruledit/comments-3.3.txt @@ -748,7 +748,6 @@ extras = "\ ; [resource_*] / [base_*] / [road_*] section)\n\ ; rmcauses = events that can remove extra type.\n\ ; \"Clean\", \"Pillage\", \"Disappear\", or \"Enter\"\n\ -; For now also \"CleanPollution\", \"CleanFallout\"\n\ ; infracost = Number of infrapoints it costs to place this\n\ ; extra. 0, the default, means extra cannot be placed.\n\ ; graphic = tag specifying preferred graphic\n\ diff --git a/data/sandbox/terrain.ruleset b/data/sandbox/terrain.ruleset index 3f3598fddc..896099310b 100644 --- a/data/sandbox/terrain.ruleset +++ b/data/sandbox/terrain.ruleset @@ -1137,7 +1137,6 @@ ui_name_base_airbase = _("?gui_type:Build Airstrip/Airbase") ; [resource_*] / [base_*] / [road_*] section) ; rmcauses = events that can remove extra type. ; "Clean", "Pillage", "Disappear", or "Enter" -; For now also "CleanPollution", "CleanFallout" ; infracost = Number of infrapoints it costs to place this ; extra. 0, the default, means extra cannot be placed. ; graphic = tag specifying preferred graphic diff --git a/data/stub/terrain.ruleset b/data/stub/terrain.ruleset index 0a4426c73e..edc54fe5c1 100644 --- a/data/stub/terrain.ruleset +++ b/data/stub/terrain.ruleset @@ -357,7 +357,6 @@ ui_name_base_airbase = _("?gui_type:Build Type B Base") ; [resource_*] / [base_*] / [road_*] section) ; rmcauses = events that can remove extra type. ; "Clean", "Pillage", "Disappear", or "Enter" -; For now also "CleanPollution", "CleanFallout" ; infracost = Number of infrapoints it costs to place this ; extra. 0, the default, means extra cannot be placed. ; graphic = tag specifying preferred graphic diff --git a/data/webperimental/terrain.ruleset b/data/webperimental/terrain.ruleset index eaea28824c..03cf81a50c 100644 --- a/data/webperimental/terrain.ruleset +++ b/data/webperimental/terrain.ruleset @@ -1115,7 +1115,6 @@ ui_name_base_airbase = _("?gui_type:Build Airbase") ; [resource_*] / [base_*] / [road_*] section) ; rmcauses = events that can remove extra type. ; "Clean", "Pillage", "Disappear", or "Enter" -; For now also "CleanPollution", "CleanFallout" ; infracost = Number of infrapoints it costs to place this ; extra. 0, the default, means extra cannot be placed. ; graphic = tag specifying preferred graphic diff --git a/doc/README.actions b/doc/README.actions index f8cb4d4869..04ba593d28 100644 --- a/doc/README.actions +++ b/doc/README.actions @@ -1156,34 +1156,7 @@ Actions done by a unit against a tile * the terrain of the target tile must have a non 0 clean_pollution_time or non 0 clean_fallout_time, depending on the removal cause of the extra - * the target extra must have the CleanPollution or - CleanFallout removal cause - * the target extra's rmreqs must be fulfilled - * the target extra can't have the AlwaysOnCityCenter extra flag if the - target tile has a city - * the target extra can't have the AutoOnCityCenter extra flag if the - target tile has a city and the city's owner can rebuild it - -"Clean Pollution" - clean extra from the target tile. - * UI name can be set using ui_name_clean_pollution - * actor must be on the same tile as the target. - * the actor unit has the "Settlers" unit type flag (!) - * the target extra must be present at the target tile - * the terrain of the target tile must have a non 0 clean_pollution_time - * the target extra must have the CleanPollution removal cause - * the target extra's rmreqs must be fulfilled - * the target extra can't have the AlwaysOnCityCenter extra flag if the - target tile has a city - * the target extra can't have the AutoOnCityCenter extra flag if the - target tile has a city and the city's owner can rebuild it - -"Clean Fallout" - clean extra from the target tile. - * UI name can be set using ui_name_clean_fallout - * actor must be on the same tile as the target. - * the actor unit has the "Settlers" unit type flag (!) - * the target extra must be present at the target tile - * the terrain of the target tile must have a non 0 clean_fallout_time - * the target extra must have the CleanFallout removal cause + * the target extra must have the Clean removal cause * the target extra's rmreqs must be fulfilled * the target extra can't have the AlwaysOnCityCenter extra flag if the target tile has a city diff --git a/server/advisors/advdata.c b/server/advisors/advdata.c index ec5de35f6f..9f987d1da1 100644 --- a/server/advisors/advdata.c +++ b/server/advisors/advdata.c @@ -920,8 +920,6 @@ adv_want adv_gov_action_immunity_want(struct government *gov) case ACTRES_MINE: case ACTRES_IRRIGATE: case ACTRES_CLEAN: - case ACTRES_CLEAN_POLLUTION: - case ACTRES_CLEAN_FALLOUT: case ACTRES_TRANSPORT_DEBOARD: case ACTRES_TRANSPORT_UNLOAD: case ACTRES_TRANSPORT_DISEMBARK: @@ -929,8 +927,8 @@ adv_want adv_gov_action_immunity_want(struct government *gov) case ACTRES_TRANSPORT_LOAD: case ACTRES_TRANSPORT_EMBARK: /* Could be good. An embassy gives permanent contact. A trade - * route gives gold per turn. Join city gives population. Help - * wonder gives shields. */ + * route gives gold per turn. Join city gives population. + * Help wonder gives shields. */ /* TODO: Individual and well balanced values. */ break; diff --git a/server/rssanity.c b/server/rssanity.c index 63c50c4a8a..6d38347b76 100644 --- a/server/rssanity.c +++ b/server/rssanity.c @@ -1196,8 +1196,7 @@ bool sanity_check_ruleset_data(struct rscompat_info *compat) } if ((requirement_vector_size(&pextra->rmreqs) > 0) && !(pextra->rmcauses - & (ERM_ENTER | ERM_CLEAN | ERM_PILLAGE - | ERM_CLEANPOLLUTION | ERM_CLEANFALLOUT))) { + & (ERM_ENTER | ERM_CLEAN | ERM_PILLAGE))) { ruleset_error(logger, LOG_WARN, "Requirements for extra removal defined but not " "a valid remove cause!"); diff --git a/server/savegame/savecompat.c b/server/savegame/savecompat.c index bac8f53379..a57d905feb 100644 --- a/server/savegame/savecompat.c +++ b/server/savegame/savecompat.c @@ -1657,8 +1657,6 @@ static void unit_order_activity_to_action(struct unit *act_unit) switch (order->activity) { case ACTIVITY_CLEAN: - case ACTIVITY_POLLUTION: - case ACTIVITY_FALLOUT: case ACTIVITY_MINE: case ACTIVITY_IRRIGATE: case ACTIVITY_PLANT: diff --git a/server/savegame/savegame2.c b/server/savegame/savegame2.c index 9e5e82cadb..5ea4b973ac 100644 --- a/server/savegame/savegame2.c +++ b/server/savegame/savegame2.c @@ -142,7 +142,9 @@ extern bool sg_success; #define ACTIVITY_OLD_ROAD (ACTIVITY_LAST + 1) #define ACTIVITY_OLD_RAILROAD (ACTIVITY_LAST + 2) -#define ACTIVITY_LAST_SAVEGAME2 (ACTIVITY_LAST + 3) +#define ACTIVITY_OLD_POLLUTION_SG2 (ACTIVITY_OLD_RAILROAD + 1) +#define ACTIVITY_OLD_FALLOUT_SG2 (ACTIVITY_OLD_POLLUTION_SG2 + 1) +#define ACTIVITY_LAST_SAVEGAME2 (ACTIVITY_OLD_FALLOUT_SG2 + 1) /* * This loops over the entire map to save data. It collects all the data of @@ -659,7 +661,7 @@ static char activity2char(int activity) return 'w'; case ACTIVITY_CLEAN: return 'C'; - case ACTIVITY_POLLUTION: + case ACTIVITY_OLD_POLLUTION_SG2: return 'p'; case ACTIVITY_OLD_ROAD: return 'r'; @@ -683,7 +685,7 @@ static char activity2char(int activity) return 'o'; case ACTIVITY_FORTIFYING: return 'y'; - case ACTIVITY_FALLOUT: + case ACTIVITY_OLD_FALLOUT_SG2: return 'u'; case ACTIVITY_BASE: return 'b'; @@ -4150,25 +4152,16 @@ static bool sg_load_player_unit(struct loaddata *loading, } else { set_unit_activity_targeted(punit, ACTIVITY_MINE, NULL); } - } else if (activity == ACTIVITY_POLLUTION) { + } else if (activity == ACTIVITY_OLD_POLLUTION_SG2 + || activity == ACTIVITY_OLD_FALLOUT_SG2) { struct extra_type *tgt = prev_extra_in_tile(unit_tile(punit), - ERM_CLEANPOLLUTION, + ERM_CLEAN, unit_owner(punit), punit); if (tgt != NULL) { - set_unit_activity_targeted(punit, ACTIVITY_POLLUTION, tgt); + set_unit_activity_targeted(punit, ACTIVITY_CLEAN, tgt); } else { - set_unit_activity_targeted(punit, ACTIVITY_POLLUTION, NULL); - } - } else if (activity == ACTIVITY_FALLOUT) { - struct extra_type *tgt = prev_extra_in_tile(unit_tile(punit), - ERM_CLEANFALLOUT, - unit_owner(punit), - punit); - if (tgt != NULL) { - set_unit_activity_targeted(punit, ACTIVITY_FALLOUT, tgt); - } else { - set_unit_activity_targeted(punit, ACTIVITY_FALLOUT, NULL); + set_unit_activity_targeted(punit, ACTIVITY_CLEAN, NULL); } } else { set_unit_activity_targeted(punit, activity, NULL); @@ -4249,19 +4242,10 @@ static bool sg_load_player_unit(struct loaddata *loading, } else { punit->changed_from_target = NULL; } - } else if (punit->changed_from == ACTIVITY_POLLUTION) { - struct extra_type *tgt = prev_extra_in_tile(unit_tile(punit), - ERM_CLEANPOLLUTION, - unit_owner(punit), - punit); - if (tgt != NULL) { - punit->changed_from_target = tgt; - } else { - punit->changed_from_target = NULL; - } - } else if (punit->changed_from == ACTIVITY_FALLOUT) { + } else if (punit->changed_from == ACTIVITY_OLD_POLLUTION_SG2 + || punit->changed_from == ACTIVITY_OLD_FALLOUT_SG2) { struct extra_type *tgt = prev_extra_in_tile(unit_tile(punit), - ERM_CLEANFALLOUT, + ERM_CLEAN, unit_owner(punit), punit); if (tgt != NULL) { diff --git a/server/savegame/savegame3.c b/server/savegame/savegame3.c index 2524f51369..be9226c595 100644 --- a/server/savegame/savegame3.c +++ b/server/savegame/savegame3.c @@ -148,6 +148,10 @@ extern bool sg_success; +#define ACTIVITY_OLD_POLLUTION_SG3 (ACTIVITY_LAST + 1) +#define ACTIVITY_OLD_FALLOUT_SG3 (ACTIVITY_OLD_POLLUTION_SG3 + 1) +#define ACTIVITY_LAST_SAVEGAME3 (ACTIVITY_OLD_FALLOUT_SG3 + 1) + #ifdef FREECIV_TESTMATIC #define SAVE_DUMMY_TURN_CHANGE_TIME 1 #endif @@ -292,7 +296,7 @@ static enum unit_orders char2order(char order); static char order2char(enum unit_orders order); static enum direction8 char2dir(char dir); static char dir2char(enum direction8 dir); -static char activity2char(enum unit_activity activity); +static char activity2char(int activity); static enum unit_activity char2activity(char activity); static char *quote_block(const void *const data, int length); static int unquote_block(const char *const quoted_, void *dest, @@ -807,15 +811,18 @@ static char dir2char(enum direction8 dir) /************************************************************************//** Returns a character identifier for an activity. See also char2activity(). + + activity type is 'int', and not 'enum_activity' for supporting + deprecated values (..._OLD_...) ****************************************************************************/ -static char activity2char(enum unit_activity activity) +static char activity2char(int activity) { switch (activity) { case ACTIVITY_IDLE: return 'w'; case ACTIVITY_CLEAN: return 'C'; - case ACTIVITY_POLLUTION: + case ACTIVITY_OLD_POLLUTION_SG3: return 'p'; case ACTIVITY_MINE: return 'm'; @@ -839,7 +846,7 @@ static char activity2char(enum unit_activity activity) return 'o'; case ACTIVITY_FORTIFYING: return 'y'; - case ACTIVITY_FALLOUT: + case ACTIVITY_OLD_FALLOUT_SG3: return 'u'; case ACTIVITY_BASE: return 'b'; @@ -863,7 +870,7 @@ static enum unit_activity char2activity(char activity) { enum unit_activity a; - for (a = 0; a < ACTIVITY_LAST; a++) { + for (a = 0; a < ACTIVITY_LAST_SAVEGAME3; a++) { char achar = activity2char(a); if (activity == achar) { diff --git a/server/unithand.c b/server/unithand.c index a3016da199..1ed05e57fb 100644 --- a/server/unithand.c +++ b/server/unithand.c @@ -1158,8 +1158,6 @@ static struct player *need_war_player_hlp(const struct unit *actor, case ACTRES_PLANT: case ACTRES_PILLAGE: case ACTRES_CLEAN: - case ACTRES_CLEAN_POLLUTION: - case ACTRES_CLEAN_FALLOUT: case ACTRES_FORTIFY: case ACTRES_CONVERT: case ACTRES_ROAD: @@ -3935,8 +3933,6 @@ bool unit_perform_action(struct player *pplayer, &target_extra)); break; case ACTRES_CLEAN: - case ACTRES_CLEAN_POLLUTION: - case ACTRES_CLEAN_FALLOUT: ACTION_PERFORM_UNIT_TILE(action_type, actor_unit, target_tile, do_action_activity_targeted(actor_unit, paction, diff --git a/server/unittools.c b/server/unittools.c index 1602f0b9c6..a43153735c 100644 --- a/server/unittools.c +++ b/server/unittools.c @@ -902,14 +902,12 @@ static void update_unit_activity(struct unit *punit) break; case ACTIVITY_CLEAN: - case ACTIVITY_POLLUTION: case ACTIVITY_MINE: case ACTIVITY_IRRIGATE: case ACTIVITY_PILLAGE: case ACTIVITY_CULTIVATE: case ACTIVITY_PLANT: case ACTIVITY_TRANSFORM: - case ACTIVITY_FALLOUT: case ACTIVITY_BASE: case ACTIVITY_GEN_ROAD: punit->activity_count += get_activity_rate_this_turn(punit); @@ -962,22 +960,9 @@ static void update_unit_activity(struct unit *punit) NULL, punit); if (pextra != NULL) { punit->activity_target = pextra; - } else { - pextra = prev_extra_in_tile(ptile, ERM_CLEANPOLLUTION, - NULL, punit); - - if (pextra != NULL) { - punit->activity_target = pextra; - } else { - pextra = prev_extra_in_tile(ptile, ERM_CLEANFALLOUT, - NULL, punit); - punit->activity_target = pextra; - } } } else { - if (is_extra_removed_by(punit->activity_target, ERM_CLEAN) - || is_extra_removed_by(punit->activity_target, ERM_CLEANPOLLUTION) - || is_extra_removed_by(punit->activity_target, ERM_CLEANFALLOUT)) { + if (is_extra_removed_by(punit->activity_target, ERM_CLEAN)) { pextra = punit->activity_target; } else { pextra = NULL; @@ -993,32 +978,6 @@ static void update_unit_activity(struct unit *punit) } break; - case ACTIVITY_POLLUTION: - /* TODO: Remove this fallback target setting when target always correctly - * set */ - if (punit->activity_target == NULL) { - punit->activity_target = prev_extra_in_tile(ptile, ERM_CLEANPOLLUTION, - NULL, punit); - } - if (total_activity_done(ptile, ACTIVITY_POLLUTION, punit->activity_target)) { - destroy_extra(ptile, punit->activity_target); - unit_activity_done = TRUE; - } - break; - - case ACTIVITY_FALLOUT: - /* TODO: Remove this fallback target setting when target always correctly - * set */ - if (punit->activity_target == NULL) { - punit->activity_target = prev_extra_in_tile(ptile, ERM_CLEANFALLOUT, - NULL, punit); - } - if (total_activity_done(ptile, ACTIVITY_FALLOUT, punit->activity_target)) { - destroy_extra(ptile, punit->activity_target); - unit_activity_done = TRUE; - } - break; - case ACTIVITY_BASE: { if (total_activity(ptile, ACTIVITY_BASE, punit->activity_target) @@ -3700,8 +3659,6 @@ static void check_unit_activity(struct unit *punit) case ACTIVITY_GOTO: break; case ACTIVITY_CLEAN: - case ACTIVITY_POLLUTION: - case ACTIVITY_FALLOUT: case ACTIVITY_MINE: case ACTIVITY_IRRIGATE: case ACTIVITY_CULTIVATE: -- 2.40.1