From 99ec601b8052ac2d05bf324cabecf0a9aa813d58 Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Fri, 17 Jan 2025 02:53:13 +0200
Subject: [PATCH 19/19] Clean out 3.2 -> 3.3 rscompat code

See RM #1215

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 common/actions.c          |  12 --
 common/game.h             |   4 -
 common/tech.h             |   4 +-
 common/unittype.c         |   3 -
 server/ruleset/rscompat.c | 338 +++-----------------------------------
 server/ruleset/rscompat.h |  15 +-
 server/ruleset/ruleload.c | 133 ++++-----------
 7 files changed, 60 insertions(+), 449 deletions(-)

diff --git a/common/actions.c b/common/actions.c
index f0f4975a8d..5ca059cea4 100644
--- a/common/actions.c
+++ b/common/actions.c
@@ -7558,18 +7558,6 @@ bool action_ever_possible(action_id action)
 const char *gen_action_name_update_cb(const char *old_name)
 {
   if (is_ruleset_compat_mode()) {
-    if (!fc_strcasecmp("Conquer City", old_name)) {
-      return "Conquer City Shrink";
-    }
-    if (!fc_strcasecmp("Conquer City 2", old_name)) {
-      return "Conquer City Shrink 2";
-    }
-    if (!fc_strcasecmp("Conquer City 3", old_name)) {
-      return "Conquer City Shrink 3";
-    }
-    if (!fc_strcasecmp("Conquer City 4", old_name)) {
-      return "Conquer City Shrink 4";
-    }
   }
 
   return old_name;
diff --git a/common/game.h b/common/game.h
index 5fefdb5294..75ac78e7c2 100644
--- a/common/game.h
+++ b/common/game.h
@@ -127,10 +127,6 @@ struct civ_game {
       /* Defined in the ruleset. */
 
       /* Game settings & other data. */
-      struct {
-        bool civil_war_enabled;
-      } deprecated;
-
       enum city_names_mode allowed_city_names;
       enum plrcolor_mode plrcolormode;
       int aqueductloss;
diff --git a/common/tech.h b/common/tech.h
index f5fbd5303b..b4dbbd8a0a 100644
--- a/common/tech.h
+++ b/common/tech.h
@@ -93,13 +93,15 @@ typedef int Tech_type_id;
 #define SPECENUM_VALUE9 TECH_USER_7
 #define SPECENUM_VALUE10 TECH_USER_8
 #define SPECENUM_VALUE11 TECH_USER_9
-#define SPECENUM_VALUE12 TECH_USER_LAST
+#define SPECENUM_VALUE12 TECH_USER_10
 /* Keep this last. */
 #define SPECENUM_COUNT TF_COUNT
 #define SPECENUM_BITVECTOR bv_tech_flags
 #define SPECENUM_NAMEOVERRIDE
 #include "specenum_gen.h"
 
+#define TECH_USER_LAST TECH_USER_10
+
 #define MAX_NUM_USER_TECH_FLAGS (TECH_USER_LAST - TECH_USER_1 + 1)
 
 enum tech_req {
diff --git a/common/unittype.c b/common/unittype.c
index abd4b9fcd1..a01a4ceadc 100644
--- a/common/unittype.c
+++ b/common/unittype.c
@@ -3020,9 +3020,6 @@ bool utype_flag_is_in_use(enum unit_type_flag_id uflag)
 const char *unit_type_flag_id_name_update_cb(const char *old_name)
 {
   if (is_ruleset_compat_mode()) {
-    if (!strcasecmp("Settlers", old_name)) {
-      return "Workers";
-    }
   }
 
   return old_name;
diff --git a/server/ruleset/rscompat.c b/server/ruleset/rscompat.c
index b6bc206dc2..50f3bb2040 100644
--- a/server/ruleset/rscompat.c
+++ b/server/ruleset/rscompat.c
@@ -49,8 +49,8 @@ FC_STATIC_ASSERT((ARRAY_SIZE(_new_flags_)                                 \
                   <= _LAST_USER_FLAG_ - _LAST_USER_FLAG_PREV_),           \
                  not_enough_new_##_name_##_user_flags)
 
-#define UTYF_LAST_USER_FLAG_3_2 UTYF_USER_FLAG_50
-#define TECH_LAST_USER_FLAG_3_2 TECH_USER_7
+#define UTYF_LAST_USER_FLAG_3_3 UTYF_USER_FLAG_53
+#define TECH_LAST_USER_FLAG_3_3 TECH_USER_10
 
 static int first_free_unit_type_user_flag(void);
 static int first_free_tech_user_flag(void);
@@ -302,16 +302,6 @@ void rscompat_enablers_add_obligatory_hard_reqs(void)
   action_iterate(act_id) {
     bool restart_enablers_for_action;
 
-    /* RSFORMAT_3_3 */
-    if (action_has_result(action_by_number(act_id), ACTRES_COLLECT_RANSOM)) {
-      action_enabler_list_iterate(action_enablers_for_action(act_id), ae) {
-        requirement_vector_append(&ae->target_reqs,
-                                  req_from_str("PlayerState", "Player",
-                                               FALSE, TRUE, TRUE,
-                                               "Barbarian"));
-      } action_enabler_list_iterate_end;
-    }
-
     do {
       restart_enablers_for_action = FALSE;
       action_enabler_list_iterate(action_enablers_for_action(act_id), ae) {
@@ -344,33 +334,30 @@ void rscompat_enablers_add_obligatory_hard_reqs(void)
 **************************************************************************/
 bool rscompat_names(struct rscompat_info *info)
 {
-  if (info->version < RSFORMAT_3_3) {
+  if (info->version < RSFORMAT_3_4) {
     int first_free;
     int i;
 
-    /* Some unit type flags moved to the ruleset between 3.2 and 3.3.
+    /* Some unit type flags moved to the ruleset between 3.3 and 3.4.
      * Add them back as user flags.
      * XXX: ruleset might not need all of these, and may have enough
      * flags of its own that these additional ones prevent conversion. */
     const struct {
       const char *name;
       const char *helptxt;
-    } new_flags_33[] = {
-      { N_("NoVeteran"), N_("May acquire veteran status.") },
-      { N_("CanEscape"), N_("Can try to escape stack death.") },
-      { N_("Shield2Gold"), N_("May switch from shield upkeep to gold upkeep") }
+    } new_flags_34[] = {
     };
 
-    enough_new_user_flags(new_flags_33, unit_type,
-                          UTYF_LAST_USER_FLAG, UTYF_LAST_USER_FLAG_3_2);
+    enough_new_user_flags(new_flags_34, unit_type,
+                          UTYF_LAST_USER_FLAG, UTYF_LAST_USER_FLAG_3_3);
 
     /* Unit type flags. */
     first_free = first_free_unit_type_user_flag() + UTYF_USER_FLAG_1;
 
-    for (i = 0; i < ARRAY_SIZE(new_flags_33); i++) {
+    for (i = 0; i < ARRAY_SIZE(new_flags_34); i++) {
       if (UTYF_USER_FLAG_1 + MAX_NUM_USER_UNIT_FLAGS <= first_free + i) {
         /* Can't add the user unit type flags. */
-        ruleset_error(NULL, LOG_ERROR,
+        ruleset_error(nullptr, LOG_ERROR,
                       "Can't upgrade the ruleset. Not enough free unit type "
                       "user flags to add user flags for the unit type flags "
                       "that used to be hardcoded.");
@@ -378,47 +365,43 @@ bool rscompat_names(struct rscompat_info *info)
       }
       /* Shouldn't be possible for valid old ruleset to have flag names that
        * clash with these ones */
-      if (unit_type_flag_id_by_name(new_flags_33[i].name, fc_strcasecmp)
+      if (unit_type_flag_id_by_name(new_flags_34[i].name, fc_strcasecmp)
           != unit_type_flag_id_invalid()) {
-        ruleset_error(NULL, LOG_ERROR,
+        ruleset_error(nullptr, LOG_ERROR,
                       "Ruleset had illegal user unit type flag '%s'",
-                      new_flags_33[i].name);
+                      new_flags_34[i].name);
         return FALSE;
       }
       set_user_unit_type_flag_name(first_free + i,
-                                   new_flags_33[i].name,
-                                   new_flags_33[i].helptxt);
+                                   new_flags_34[i].name,
+                                   new_flags_34[i].helptxt);
     }
   }
 
-  if (info->version < RSFORMAT_3_3) {
+  if (info->version < RSFORMAT_3_4) {
     int first_free;
     int i;
 
-    /* Some tech flags moved to the ruleset between 3.2 and 3.3.
+    /* Some tech flags moved to the ruleset between 3.3 and 3.4.
      * Add them back as user flags.
      * XXX: ruleset might not need all of these, and may have enough
      * flags of its own that these additional ones prevent conversion. */
     const struct {
       const char *name;
       const char *helptxt;
-    } new_flags_33[] = {
-      { N_("Claim_Ocean"),
-        N_("National borders expand freely into the ocean.") },
-      { N_("Claim_Ocean_Limited"),
-        N_("National borders from oceanic sources expand freely.") },
+    } new_flags_34[] = {
     };
 
-    enough_new_user_flags(new_flags_33, tech,
-                          (TECH_USER_LAST - 1), TECH_LAST_USER_FLAG_3_2);
+    enough_new_user_flags(new_flags_34, tech,
+                          (TECH_USER_LAST - 1), TECH_LAST_USER_FLAG_3_3);
 
     /* Tech flags. */
     first_free = first_free_tech_user_flag() + TECH_USER_1;
 
-    for (i = 0; i < ARRAY_SIZE(new_flags_33); i++) {
+    for (i = 0; i < ARRAY_SIZE(new_flags_34); i++) {
       if (TECH_USER_1 + MAX_NUM_USER_TECH_FLAGS <= first_free + i) {
         /* Can't add the user unit type flags. */
-        ruleset_error(NULL, LOG_ERROR,
+        ruleset_error(nullptr, LOG_ERROR,
                       "Can't upgrade the ruleset. Not enough free tech "
                       "user flags to add user flags for the tech flags "
                       "that used to be hardcoded.");
@@ -426,16 +409,16 @@ bool rscompat_names(struct rscompat_info *info)
       }
       /* Shouldn't be possible for valid old ruleset to have flag names that
        * clash with these ones */
-      if (tech_flag_id_by_name(new_flags_33[i].name, fc_strcasecmp)
+      if (tech_flag_id_by_name(new_flags_34[i].name, fc_strcasecmp)
           != tech_flag_id_invalid()) {
-        ruleset_error(NULL, LOG_ERROR,
+        ruleset_error(nullptr, LOG_ERROR,
                       "Ruleset had illegal user tech flag '%s'",
-                      new_flags_33[i].name);
+                      new_flags_34[i].name);
         return FALSE;
       }
       set_user_tech_flag_name(first_free + i,
-                              new_flags_33[i].name,
-                              new_flags_33[i].helptxt);
+                              new_flags_34[i].name,
+                              new_flags_34[i].helptxt);
     }
   }
 
@@ -450,13 +433,7 @@ static bool effect_list_compat_cb(struct effect *peffect, void *data)
 {
   struct rscompat_info *info = (struct rscompat_info *)data;
 
-  if (info->version < RSFORMAT_3_3) {
-    if (peffect->type == EFT_SHIELD2GOLD_FACTOR) {
-      requirement_vector_append(&(peffect->reqs),
-                                req_from_str("UnitTypeFlag", "Local",
-                                             FALSE, FALSE, FALSE,
-                                             "Shield2Gold"));
-    }
+  if (info->version < RSFORMAT_3_4) {
   }
 
   /* Go to the next effect. */
@@ -468,128 +445,16 @@ static bool effect_list_compat_cb(struct effect *peffect, void *data)
 **************************************************************************/
 void rscompat_postprocess(struct rscompat_info *info)
 {
-  struct action_enabler *enabler;
-  struct effect *effect;
-  struct requirement e_req;
-
   if (!info->compat_mode || info->version >= RSFORMAT_CURRENT) {
     /* There isn't anything here that should be done outside of compat
      * mode. */
     return;
   }
 
-  unit_type_iterate(ptype) {
-    if (utype_has_role(ptype, L_BARBARIAN_LEADER)) {
-      BV_SET(ptype->flags, UTYF_PROVIDES_RANSOM);
-    }
-  } unit_type_iterate_end;
-
-  enabler = action_enabler_new();
-  enabler->action = ACTION_GAIN_VETERANCY;
-  e_req = req_from_str("UnitTypeFlag", "Local", FALSE, FALSE, FALSE,
-                       "NoVeteran");
-  requirement_vector_append(&enabler->actor_reqs, e_req);
-  action_enabler_add(enabler);
-
-  enabler = action_enabler_new();
-  enabler->action = ACTION_ESCAPE;
-  e_req = req_from_str("UnitTypeFlag", "Local", FALSE, TRUE, FALSE,
-                       "CanEscape");
-  requirement_vector_append(&enabler->actor_reqs, e_req);
-  action_enabler_add(enabler);
-
-  if (game.server.deprecated.civil_war_enabled) {
-    enabler = action_enabler_new();
-    enabler->action = ACTION_CIVIL_WAR;
-    action_enabler_add(enabler);
-  }
-
   /* Upgrade existing effects. Done before new effects are added to prevent
    * the new effects from being upgraded by accident. */
   iterate_effect_cache(effect_list_compat_cb, info);
 
-  /* Old hardcoded behavior always had tech leakage enabled,
-   * thought limited by game.info.tech_leakage setting. */
-  effect_new(EFT_TECH_LEAKAGE, 1, nullptr);
-
-  /* Old behavior: Land tiles can be claimed by land border sources on the
-   * same continent. */
-  effect = effect_new(EFT_TILE_CLAIMABLE, 1, nullptr);
-  e_req = req_from_values(VUT_TERRAINCLASS, REQ_RANGE_TILE,
-                          FALSE, TRUE, FALSE, TC_LAND);
-  effect_req_append(effect, e_req);
-  e_req = req_from_values(VUT_TILE_REL, REQ_RANGE_TILE,
-                          FALSE, TRUE, FALSE, TREL_SAME_REGION);
-  effect_req_append(effect, e_req);
-  /* Tile-range TREL_SAME_REGION implies TREL_SAME_TCLASS */
-
-  /* Old behavior: Oceanic tiles can be claimed by adjacent border
-   * sources. */
-  effect = effect_new(EFT_TILE_CLAIMABLE, 1, nullptr);
-  e_req = req_from_values(VUT_TERRAINCLASS, REQ_RANGE_TILE,
-                          FALSE, TRUE, FALSE, TC_OCEAN);
-  effect_req_append(effect, e_req);
-  e_req = req_from_values(VUT_MAX_DISTANCE_SQ, REQ_RANGE_TILE,
-                          FALSE, TRUE, FALSE, 2);
-  effect_req_append(effect, e_req);
-
-  /* Old behavior: Oceanic tiles part of an ocean that is no larger than
-   * MAXIMUM_CLAIMED_OCEAN_SIZE tiles and that is adjacent to only one
-   * continent (i.e. surrounded by it) can be claimed by land border
-   * sources on that continent. */
-  effect = effect_new(EFT_TILE_CLAIMABLE, 1, nullptr);
-  e_req = req_from_values(VUT_TERRAINCLASS, REQ_RANGE_TILE,
-                          FALSE, TRUE, FALSE, TC_OCEAN);
-  effect_req_append(effect, e_req);
-  e_req = req_from_values(VUT_MAX_REGION_TILES, REQ_RANGE_CONTINENT,
-                          FALSE, TRUE, FALSE,
-                          MAXIMUM_CLAIMED_OCEAN_SIZE_3_2);
-  effect_req_append(effect, e_req);
-  e_req = req_from_values(VUT_TILE_REL, REQ_RANGE_TILE,
-                          FALSE, TRUE, FALSE, TREL_REGION_SURROUNDED);
-  effect_req_append(effect, e_req);
-  /* Tile-range TREL_REGION_SURROUNDED implies negated TREL_SAME_TCLASS */
-
-  /* Old behavior: Oceanic tiles adjacent to no more than two other oceanic
-   * tiles and (individually) adjacent to only a single continent can be
-   * claimed by land border sources on that continent. */
-  effect = effect_new(EFT_TILE_CLAIMABLE, 1, nullptr);
-  e_req = req_from_values(VUT_TERRAINCLASS, REQ_RANGE_TILE,
-                          FALSE, TRUE, FALSE, TC_OCEAN);
-  effect_req_append(effect, e_req);
-  e_req = req_from_values(VUT_TILE_REL, REQ_RANGE_TILE,
-                          FALSE, FALSE, FALSE, TREL_SAME_TCLASS);
-  effect_req_append(effect, e_req);
-  e_req = req_from_values(VUT_MAX_REGION_TILES, REQ_RANGE_ADJACENT,
-                          FALSE, TRUE, FALSE, 2 + 1);
-  effect_req_append(effect, e_req);
-  e_req = req_from_values(VUT_TILE_REL, REQ_RANGE_ADJACENT,
-                          FALSE, TRUE, FALSE, TREL_ONLY_OTHER_REGION);
-  effect_req_append(effect, e_req);
-
-  /* Old behavior: Oceanic tiles can be claimed by any oceanic border
-   * sources with the Claim_Ocean_Limited techflag. */
-  effect = effect_new(EFT_TILE_CLAIMABLE, 1, nullptr);
-  e_req = req_from_values(VUT_TERRAINCLASS, REQ_RANGE_TILE,
-                          FALSE, TRUE, FALSE, TC_OCEAN);
-  effect_req_append(effect, e_req);
-  e_req = req_from_values(VUT_TILE_REL, REQ_RANGE_TILE,
-                          FALSE, TRUE, FALSE, TREL_SAME_TCLASS);
-  effect_req_append(effect, e_req);
-  e_req = req_from_str("TechFlag", "Player", FALSE, TRUE, FALSE,
-                       "Claim_Ocean_Limited");
-  effect_req_append(effect, e_req);
-
-  /* Old behavior: Oceanic tiles can be claimed by any border sources
-   * with the Claim_Ocean techflag. */
-  effect = effect_new(EFT_TILE_CLAIMABLE, 1, nullptr);
-  e_req = req_from_values(VUT_TERRAINCLASS, REQ_RANGE_TILE,
-                          FALSE, TRUE, FALSE, TC_OCEAN);
-  effect_req_append(effect, e_req);
-  e_req = req_from_str("TechFlag", "Player", FALSE, TRUE, FALSE,
-                       "Claim_Ocean");
-  effect_req_append(effect, e_req);
-
   /* Make sure that all action enablers added or modified by the
    * compatibility post processing fulfills all hard action requirements. */
   rscompat_enablers_add_obligatory_hard_reqs();
@@ -640,152 +505,3 @@ static int first_free_tech_user_flag(void)
   /* All tech user flags are taken. */
   return MAX_NUM_USER_TECH_FLAGS;
 }
-
-/**********************************************************************//**
-  Convert 3.2 unit type flag name to 3.3 one.
-**************************************************************************/
-const char *rscompat_utype_flag_name_3_3(const char *old_name)
-{
-  if (!fc_strcasecmp("Settlers", old_name)) {
-    return "Workers";
-  }
-
-  return old_name;
-}
-
-/**********************************************************************//**
-  Convert 3.2 universal name to a 3.3 one.
-**************************************************************************/
-const char *rscompat_universal_name_3_3(const char *old_name)
-{
-  if (!fc_strcasecmp("UnitFlag", old_name)) {
-    return "UnitTypeFlag";
-  }
-
-  return old_name;
-}
-
-/**********************************************************************//**
-  Convert 3.2 effect name to a 3.3 one.
-**************************************************************************/
-const char *rscompat_effect_name_3_3(const char *old_name)
-{
-  if (!fc_strcasecmp("Martial_Law_Each", old_name)) {
-    return "Martial_Law_By_Unit";
-  }
-
-  return old_name;
-}
-
-/**********************************************************************//**
-  Tell 3.2 blocked_by name matching 3.3 one
-**************************************************************************/
-const char *blocked_by_old_name_3_3(const char *new_name)
-{
-  if (!fc_strcasecmp("conquer_city_shrink_blocked_by", new_name)) {
-    return "conquer_city_blocked_by";
-  }
-  if (!fc_strcasecmp("conquer_city_shrink_2_blocked_by", new_name)) {
-    return "conquer_city_2_blocked_by";
-  }
-  if (!fc_strcasecmp("conquer_city_shrink_3_blocked_by", new_name)) {
-    return "conquer_city_3_blocked_by";
-  }
-  if (!fc_strcasecmp("conquer_city_shrink_4_blocked_by", new_name)) {
-    return "conquer_city_4_blocked_by";
-  }
-
-  return nullptr;
-}
-
-/**********************************************************************//**
-  Tell 3.2 ui_name matching 3.3 one
-**************************************************************************/
-const char *ui_name_old_name_3_3(const char *new_name)
-{
-  if (!fc_strcasecmp("ui_name_conquer_city_shrink", new_name)) {
-    return "ui_name_conquer_city";
-  }
-  if (!fc_strcasecmp("ui_name_conquer_city_shrink_2", new_name)) {
-    return "ui_name_conquer_city_2";
-  }
-  if (!fc_strcasecmp("ui_name_conquer_city_shrink_3", new_name)) {
-    return "ui_name_conquer_city_3";
-  }
-  if (!fc_strcasecmp("ui_name_conquer_city_shrink_4", new_name)) {
-    return "ui_name_conquer_city_4";
-  }
-  
-  return nullptr;
-}
-
-#define RS_DEFAULT_CIVIL_WAR_CELEB               -5
-#define RS_DEFAULT_CIVIL_WAR_UNHAPPY             5
-
-/**********************************************************************//**
-  Add civil war bonus effects matching old civstyle values.
-**************************************************************************/
-void rscompat_civil_war_effects_3_3(struct section_file *game_rs)
-{
-  int bonus = secfile_lookup_int_default(game_rs, RS_DEFAULT_CIVIL_WAR_CELEB,
-                                         "civstyle.civil_war_bonus_celebrating");
-
-  if (bonus != 0) {
-    struct requirement e_req;
-    struct effect *peffect;
-
-    peffect = effect_new(EFT_CIVIL_WAR_CITY_BONUS, -bonus, nullptr);
-    e_req = req_from_str("CityStatus", "City", FALSE, TRUE, FALSE,
-                         "Celebration");
-    effect_req_append(peffect, e_req);
-  }
-
-  bonus = secfile_lookup_int_default(game_rs, RS_DEFAULT_CIVIL_WAR_UNHAPPY,
-                                     "civstyle.civil_war_bonus_unhappy");
-
-  if (bonus != 0) {
-    struct requirement e_req;
-    struct effect *peffect;
-
-    peffect = effect_new(EFT_CIVIL_WAR_CITY_BONUS, -bonus, nullptr);
-    e_req = req_from_str("CityStatus", "City", FALSE, TRUE, FALSE,
-                         "Disorder");
-    effect_req_append(peffect, e_req);
-  }
-}
-
-/**********************************************************************//**
-  Load ui_name of one action
-**************************************************************************/
-bool load_action_ui_name_3_3(struct section_file *file, int act,
-                             const char *entry_name,
-                             struct rscompat_info *compat)
-{
-  const char *text;
-  const char *def = action_ui_name_default(act);
-  struct action *paction = action_by_number(act);
-
-  if (entry_name == nullptr) {
-    text = def;
-  } else {
-    text = secfile_lookup_str_default(file, nullptr,
-                                      "actions.%s", entry_name);
-
-    if (text == nullptr && compat->compat_mode && compat->version < RSFORMAT_3_3) {
-      text = secfile_lookup_str_default(file, nullptr,
-                                        "actions.%s", ui_name_old_name_3_3(entry_name));
-    }
-
-    if (text == nullptr) {
-      text = def;
-    } else {
-      if (strcmp(def, text)) {
-        paction->configured = TRUE;
-      }
-    }
-  }
-
-  sz_strlcpy(paction->ui_name, text);
-
-  return TRUE;
-}
diff --git a/server/ruleset/rscompat.h b/server/ruleset/rscompat.h
index 8ba8ca0a4d..1e5862951b 100644
--- a/server/ruleset/rscompat.h
+++ b/server/ruleset/rscompat.h
@@ -51,24 +51,11 @@ void rscompat_enablers_add_obligatory_hard_reqs(void);
 
 /* Functions from ruleset.c made visible to rscompat.c */
 struct requirement_vector *lookup_req_list(struct section_file *file,
-                                           struct rscompat_info *compat,
                                            const char *sec,
                                            const char *sub,
                                            const char *rfor);
 
-/* Functions specific to 3.2 -> 3.3 transition */
-const char *rscompat_utype_flag_name_3_3(const char *old_name);
-const char *rscompat_universal_name_3_3(const char *old_name);
-const char *rscompat_effect_name_3_3(const char *old_name);
-
-const char *blocked_by_old_name_3_3(const char *new_name);
-const char *ui_name_old_name_3_3(const char *new_name);
-
-void rscompat_civil_war_effects_3_3(struct section_file *game_rs);
-
-bool load_action_ui_name_3_3(struct section_file *file, int act,
-                             const char *entry_name,
-                             struct rscompat_info *compat);
+/* Functions specific to 3.3 -> 3.4 transition */
 
 #ifdef __cplusplus
 }
diff --git a/server/ruleset/ruleload.c b/server/ruleset/ruleload.c
index 345cc08625..6f86d9cd93 100644
--- a/server/ruleset/ruleload.c
+++ b/server/ruleset/ruleload.c
@@ -109,7 +109,6 @@
 #define DISASTER_SECTION_PREFIX "disaster_"
 #define ACHIEVEMENT_SECTION_PREFIX "achievement_"
 #define ENABLER_SECTION_PREFIX "enabler_"
-#define ACTION_ENABLER_SECTION_PREFIX "actionenabler_"
 #define ACTION_SECTION_PREFIX "action_"
 #define MULTIPLIER_SECTION_PREFIX "multiplier_"
 #define COUNTER_SECTION_PREFIX "counter_"
@@ -650,11 +649,10 @@ static struct section_file *openload_luadata_file(const char *rsdir)
 }
 
 /**********************************************************************//**
-  Load a requirement list.  The list is returned as a static vector
+  Load a requirement list. The list is returned as a static vector
   (callers need not worry about freeing anything).
 **************************************************************************/
 struct requirement_vector *lookup_req_list(struct section_file *file,
-                                           struct rscompat_info *compat,
                                            const char *sec,
                                            const char *sub,
                                            const char *rfor)
@@ -761,10 +759,6 @@ struct requirement_vector *lookup_req_list(struct section_file *file,
                     "'%s.%s%d'.", filename, sec, sub, j);
     }
 
-    if (compat->compat_mode && compat->version < RSFORMAT_3_3) {
-      type = rscompat_universal_name_3_3(type);
-    }
-
     req = req_from_str(type, range, survives, present, quiet, name);
     if (req.source.kind == universals_n_invalid()) {
       ruleset_error(NULL, LOG_ERROR,
@@ -1653,7 +1647,7 @@ static bool load_ruleset_techs(struct section_file *file,
       }
     }
 
-    research_reqs = lookup_req_list(file, compat, sec_name, "research_reqs",
+    research_reqs = lookup_req_list(file, sec_name, "research_reqs",
                                     rule_name_get(&a->name));
     if (research_reqs == NULL) {
       ok = FALSE;
@@ -2121,10 +2115,6 @@ static bool load_ruleset_units(struct section_file *file,
           continue;
         }
 
-        if (compat->compat_mode && compat->version < RSFORMAT_3_3) {
-          sval = rscompat_utype_flag_name_3_3(sval);
-        }
-
         ival = unit_class_flag_id_by_name(sval, fc_strcasecmp);
         if (!unit_class_flag_id_is_valid(ival)) {
           ok = FALSE;
@@ -2161,7 +2151,7 @@ static bool load_ruleset_units(struct section_file *file,
       const char *sec_name = section_name(psection);
       struct requirement_vector *reqs;
 
-      reqs = lookup_req_list(file, compat, sec_name, "reqs",
+      reqs = lookup_req_list(file, sec_name, "reqs",
                              utype_rule_name(u));
 
       if (reqs == NULL) {
@@ -2627,9 +2617,9 @@ static bool load_ruleset_buildings(struct section_file *file,
   for (i = 0; i < nval && ok; i++) {
     struct impr_type *b = improvement_by_number(i);
     const char *sec_name = section_name(section_list_get(sec, i));
-    struct requirement_vector *reqs =
-      lookup_req_list(file, compat, sec_name, "reqs",
-                      improvement_rule_name(b));
+    struct requirement_vector *reqs
+      = lookup_req_list(file, sec_name, "reqs",
+                        improvement_rule_name(b));
 
     if (reqs == NULL) {
       ok = FALSE;
@@ -2678,9 +2668,9 @@ static bool load_ruleset_buildings(struct section_file *file,
       requirement_vector_copy(&b->reqs, reqs);
 
       {
-        struct requirement_vector *obs_reqs =
-          lookup_req_list(file, compat, sec_name, "obsolete_by",
-                          improvement_rule_name(b));
+        struct requirement_vector *obs_reqs
+          = lookup_req_list(file, sec_name, "obsolete_by",
+                            improvement_rule_name(b));
 
         if (obs_reqs == NULL) {
           ok = FALSE;
@@ -3624,28 +3614,28 @@ static bool load_ruleset_terrain(struct section_file *file,
                  secfile_lookup_str_default(file, "-",
                                             "%s.graphic_alt", section));
 
-      reqs = lookup_req_list(file, compat, section, "reqs", extra_rule_name(pextra));
+      reqs = lookup_req_list(file, section, "reqs", extra_rule_name(pextra));
       if (reqs == NULL) {
         ok = FALSE;
         break;
       }
       requirement_vector_copy(&pextra->reqs, reqs);
 
-      reqs = lookup_req_list(file, compat, section, "rmreqs", extra_rule_name(pextra));
+      reqs = lookup_req_list(file, section, "rmreqs", extra_rule_name(pextra));
       if (reqs == NULL) {
         ok = FALSE;
         break;
       }
       requirement_vector_copy(&pextra->rmreqs, reqs);
 
-      reqs = lookup_req_list(file, compat, section, "appearance_reqs", extra_rule_name(pextra));
+      reqs = lookup_req_list(file, section, "appearance_reqs", extra_rule_name(pextra));
       if (reqs == NULL) {
         ok = FALSE;
         break;
       }
       requirement_vector_copy(&pextra->appearance_reqs, reqs);
 
-      reqs = lookup_req_list(file, compat, section, "disappearance_reqs", extra_rule_name(pextra));
+      reqs = lookup_req_list(file, section, "disappearance_reqs", extra_rule_name(pextra));
       if (reqs == NULL) {
         ok = FALSE;
         break;
@@ -4053,7 +4043,7 @@ static bool load_ruleset_terrain(struct section_file *file,
         break;
       }
 
-      reqs = lookup_req_list(file, compat, section, "first_reqs", extra_rule_name(pextra));
+      reqs = lookup_req_list(file, section, "first_reqs", extra_rule_name(pextra));
       if (reqs == NULL) {
         ok = FALSE;
         break;
@@ -4321,7 +4311,7 @@ static bool load_ruleset_governments(struct section_file *file,
       const int i = government_index(g);
       const char *sec_name = section_name(section_list_get(sec, i));
       struct requirement_vector *reqs
-        = lookup_req_list(file, compat, sec_name, "reqs", government_rule_name(g));
+        = lookup_req_list(file, sec_name, "reqs", government_rule_name(g));
 
       if (reqs == NULL) {
         ok = FALSE;
@@ -4464,7 +4454,7 @@ static bool load_ruleset_governments(struct section_file *file,
                                                        "%s.minimum_turns",
                                                        sec_name);
 
-      reqs = lookup_req_list(file, compat, sec_name, "reqs",
+      reqs = lookup_req_list(file, sec_name, "reqs",
                              multiplier_rule_name(pmul));
       if (reqs == NULL) {
         ok = FALSE;
@@ -5677,7 +5667,7 @@ static bool load_ruleset_styles(struct section_file *file,
                secfile_lookup_str_default(file, "-",
                                           "%s.citizens_graphic", sec_name));
 
-    reqs = lookup_req_list(file, compat, sec_name, "reqs", city_style_rule_name(i));
+    reqs = lookup_req_list(file, sec_name, "reqs", city_style_rule_name(i));
     if (reqs == NULL) {
       ok = FALSE;
       break;
@@ -5709,7 +5699,7 @@ static bool load_ruleset_styles(struct section_file *file,
                    secfile_lookup_str_default(file, "-",
                                               "%s.music_combat", sec_name));
 
-        reqs = lookup_req_list(file, compat, sec_name, "reqs", "Music Style");
+        reqs = lookup_req_list(file, sec_name, "reqs", "Music Style");
         if (reqs == NULL) {
           ok = FALSE;
           break;
@@ -5889,7 +5879,7 @@ static bool load_ruleset_cities(struct section_file *file,
                  secfile_lookup_str_default(file, "-",
                                             "%s.graphic_alt", sec_name));
 
-      reqs = lookup_req_list(file, compat, sec_name, "reqs", specialist_rule_name(s));
+      reqs = lookup_req_list(file, sec_name, "reqs", specialist_rule_name(s));
       if (reqs == NULL) {
         ok = FALSE;
         break;
@@ -6150,10 +6140,6 @@ static bool load_ruleset_effects(struct section_file *file,
       break;
     }
 
-    if (compat->compat_mode && compat->version < RSFORMAT_3_3) {
-      type = rscompat_effect_name_3_3(type);
-    }
-
     eff = effect_type_by_name(type, fc_strcasecmp);
     if (!effect_type_is_valid(eff)) {
       ruleset_error(NULL, LOG_ERROR,
@@ -6185,7 +6171,7 @@ static bool load_ruleset_effects(struct section_file *file,
 
     peffect = effect_new(eff, value, pmul);
 
-    reqs = lookup_req_list(file, compat, sec_name, "reqs", type);
+    reqs = lookup_req_list(file, sec_name, "reqs", type);
     if (reqs == NULL) {
       ok = FALSE;
       break;
@@ -6396,32 +6382,6 @@ static bool load_action_blocked_by_list(struct section_file *file,
       }
 
       free(blocking_actions);
-    } else if (compat->compat_mode && compat->version < RSFORMAT_3_3) {
-      fc_snprintf(fullpath, sizeof(fullpath), "actions.%s", blocked_by_old_name_3_3(var_name));
-
-      if (secfile_entry_by_path(file, fullpath)) {
-        enum gen_action *blocking_actions;
-        size_t asize;
-        int j;
-
-        blocking_actions
-          = secfile_lookup_enum_vec(file, &asize, gen_action, "%s", fullpath);
-
-        if (!blocking_actions) {
-          /* Entity exists but couldn't read it. */
-          ruleset_error(NULL, LOG_ERROR,
-                        "\"%s\": %s: bad action list",
-                        filename, fullpath);
-
-          return FALSE;
-        }
-
-        for (j = 0; j < asize; j++) {
-          BV_SET(paction->blocked_by, blocking_actions[j]);
-        }
-
-        free(blocking_actions);
-      }
     }
   }
 
@@ -6690,16 +6650,6 @@ static bool load_ruleset_game(struct section_file *file, bool act,
                                            RS_MIN_FOOD_COST,
                                            RS_MAX_FOOD_COST,
                                            "civstyle.food_cost");
-
-    if (compat->compat_mode && compat->version < RSFORMAT_3_3) {
-      game.server.deprecated.civil_war_enabled
-        = secfile_lookup_bool_default(file, TRUE, "civstyle.civil_war_enabled");
-      rscompat_civil_war_effects_3_3(file);
-    } else {
-      /* Avoid additional Civil War enabler */
-      game.server.deprecated.civil_war_enabled = FALSE;
-    }
-
     game.info.base_bribe_cost
       = secfile_lookup_int_default_min_max(file,
                                            RS_DEFAULT_BASE_BRIBE_COST,
@@ -6935,7 +6885,6 @@ static bool load_ruleset_game(struct section_file *file, bool act,
 
   if (ok) {
     const char *tus_text;
-    int pharbor_default;
 
     /* Section: combat_rules */
     game.info.tired_attack
@@ -6961,17 +6910,8 @@ static bool load_ruleset_game(struct section_file *file, bool act,
     game.info.low_firepower_badwallattacker
       = secfile_lookup_int_default(file, 1,
                                    "combat_rules.low_firepower_badwallattacker");
-
-    if (compat->compat_mode && compat->version < RSFORMAT_3_3) {
-      pharbor_default
-        = secfile_lookup_int_default(file, 1,
-                                     "combat_rules.low_firepower_pearl_harbour");
-    } else {
-      pharbor_default = 1;
-    }
-
     game.info.low_firepower_pearl_harbor
-      = secfile_lookup_int_default(file, pharbor_default,
+      = secfile_lookup_int_default(file, 1,
                                    "combat_rules.low_firepower_pearl_harbor");
 
     game.info.low_firepower_combat_bonus
@@ -7230,7 +7170,7 @@ static bool load_ruleset_game(struct section_file *file, bool act,
         break;
       }
 
-      reqs = lookup_req_list(file, compat, sec_name, "reqs", disaster_rule_name(pdis));
+      reqs = lookup_req_list(file, sec_name, "reqs", disaster_rule_name(pdis));
       if (reqs == NULL) {
         ok = FALSE;
         break;
@@ -7404,7 +7344,7 @@ static bool load_ruleset_game(struct section_file *file, bool act,
       const char **slist;
       int j;
 
-      reqs = lookup_req_list(file, compat, sec_name, "reqs", goods_rule_name(pgood));
+      reqs = lookup_req_list(file, sec_name, "reqs", goods_rule_name(pgood));
       if (reqs == NULL) {
         ok = FALSE;
         break;
@@ -7477,21 +7417,21 @@ static bool load_ruleset_game(struct section_file *file, bool act,
           break;
         }
 
-        reqs = lookup_req_list(file, compat, sec_name, "giver_reqs", clause_name);
+        reqs = lookup_req_list(file, sec_name, "giver_reqs", clause_name);
         if (reqs == NULL) {
           ok = FALSE;
           break;
         }
         requirement_vector_copy(&info->giver_reqs, reqs);
 
-        reqs = lookup_req_list(file, compat, sec_name, "receiver_reqs", clause_name);
+        reqs = lookup_req_list(file, sec_name, "receiver_reqs", clause_name);
         if (reqs == NULL) {
           ok = FALSE;
           break;
         }
         requirement_vector_copy(&info->receiver_reqs, reqs);
 
-        reqs = lookup_req_list(file, compat, sec_name, "either_reqs", clause_name);
+        reqs = lookup_req_list(file, sec_name, "either_reqs", clause_name);
         if (reqs == NULL) {
           ok = FALSE;
           break;
@@ -7598,7 +7538,7 @@ static bool load_ruleset_actions(struct section_file *file,
   auto_perf = action_auto_perf_slot_number(ACTION_AUTO_MOVED_ADJ);
   auto_perf->cause = AAPC_UNIT_MOVED_ADJ;
 
-  reqs = lookup_req_list(file, compat,
+  reqs = lookup_req_list(file,
                          "auto_attack", "if_attacker",
                          "auto_attack");
   if (reqs == NULL) {
@@ -7662,16 +7602,6 @@ static bool load_ruleset_actions(struct section_file *file,
           ok = FALSE;
         } else if (!load_action_actor_consuming_always(file, act_id)) {
           ok = FALSE;
-        } else {
-          const char *entry_name = NULL;
-
-          if (!action_id_is_internal(act_id)) {
-            entry_name = action_ui_name_ruleset_var_name(act_id);
-          }
-
-          if (compat->compat_mode && compat->version < RSFORMAT_3_3) {
-            load_action_ui_name_3_3(file, act_id, entry_name, compat);
-          }
         }
 
         if (!ok) {
@@ -7884,11 +7814,6 @@ static bool load_ruleset_actions(struct section_file *file,
   if (ok) {
     sec = secfile_sections_by_name_prefix(file, ENABLER_SECTION_PREFIX);
 
-    if (sec == nullptr && compat->compat_mode && compat->version < RSFORMAT_3_3) {
-      sec = secfile_sections_by_name_prefix(file,
-                                            ACTION_ENABLER_SECTION_PREFIX);
-    }
-
     if (sec != nullptr) {
       section_list_iterate(sec, psection) {
         struct action_enabler *enabler;
@@ -7922,7 +7847,7 @@ static bool load_ruleset_actions(struct section_file *file,
 
         enabler->action = action_id(paction);
 
-        actor_reqs = lookup_req_list(file, compat, sec_name, "actor_reqs", action_text);
+        actor_reqs = lookup_req_list(file, sec_name, "actor_reqs", action_text);
         if (actor_reqs == NULL) {
           ok = FALSE;
           break;
@@ -7930,7 +7855,7 @@ static bool load_ruleset_actions(struct section_file *file,
 
         requirement_vector_copy(&enabler->actor_reqs, actor_reqs);
 
-        target_reqs = lookup_req_list(file, compat, sec_name, "target_reqs", action_text);
+        target_reqs = lookup_req_list(file, sec_name, "target_reqs", action_text);
         if (target_reqs == NULL) {
           ok = FALSE;
           break;
-- 
2.45.2

