From 7c2a000c1e883217de51159d70c1e8e90f90f4be Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Mon, 13 May 2024 03:22:14 +0300
Subject: [PATCH 92/92] Rename goods 'priority' as 'replace_priority'

See RM #585

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 ai/default/daiunit.c            |  2 +-
 client/gui-sdl2/menu.c          |  2 +-
 client/gui-sdl3/menu.c          |  2 +-
 client/packhand.c               |  2 +-
 client/text.c                   |  2 +-
 common/actres.c                 |  2 +-
 common/aicore/caravan.c         | 10 +++--
 common/traderoutes.c            |  8 ++--
 common/traderoutes.h            |  2 +-
 data/alien/game.ruleset         |  6 +--
 data/civ1/game.ruleset          |  8 ++--
 data/civ2/game.ruleset          |  8 ++--
 data/civ2civ3/game.ruleset      |  6 +--
 data/classic/game.ruleset       |  6 +--
 data/goldkeep/game.ruleset      |  6 +--
 data/granularity/game.ruleset   |  6 +--
 data/multiplayer/game.ruleset   |  6 +--
 data/ruledit/comments-3.3.txt   |  2 +-
 data/sandbox/game.ruleset       | 74 ++++++++++++++++-----------------
 data/stub/game.ruleset          |  6 +--
 data/webperimental/game.ruleset |  6 +--
 server/citytools.c              |  2 +-
 server/ruleset/ruleload.c       |  6 +--
 server/unithand.c               |  6 ++-
 tools/ruleutil/rulesave.c       |  2 +-
 25 files changed, 97 insertions(+), 91 deletions(-)

diff --git a/ai/default/daiunit.c b/ai/default/daiunit.c
index 2101091b5c..9ce135b62e 100644
--- a/ai/default/daiunit.c
+++ b/ai/default/daiunit.c
@@ -2315,7 +2315,7 @@ static void dai_manage_caravan(struct ai_type *ait, struct player *pplayer,
         || (unit_data->task == AIUNIT_TRADE
             && !(can_cities_trade(homecity, city_dest)
                  && can_establish_trade_route(homecity, city_dest,
-                                              pgood->priority)))
+                                              pgood->replace_priority)))
         || (unit_data->task == AIUNIT_WONDER
             /* Helping the (new) production is illegal. */
             && !city_production_gets_caravan_shields(&city_dest->production))
diff --git a/client/gui-sdl2/menu.c b/client/gui-sdl2/menu.c
index 17293aea4e..26dea81cdb 100644
--- a/client/gui-sdl2/menu.c
+++ b/client/gui-sdl2/menu.c
@@ -1140,7 +1140,7 @@ void real_menus_update(void)
                                                          TRUE);
         struct goods_type *pgood = unit_current_goods(punit, homecity);
 
-        if (can_establish_trade_route(homecity, pcity, pgood->priority)) {
+        if (can_establish_trade_route(homecity, pcity, pgood->replace_priority)) {
           fc_snprintf(cbuf, sizeof(cbuf),
                       _("%s With %s ( %d one time bonus + %d trade ) (R)"),
                       action_id_name_translation(ACTION_TRADE_ROUTE),
diff --git a/client/gui-sdl3/menu.c b/client/gui-sdl3/menu.c
index 3477505ca1..ecfdb93476 100644
--- a/client/gui-sdl3/menu.c
+++ b/client/gui-sdl3/menu.c
@@ -1136,7 +1136,7 @@ void real_menus_update(void)
                                                          TRUE);
         struct goods_type *pgood = unit_current_goods(punit, homecity);
 
-        if (can_establish_trade_route(homecity, pcity, pgood->priority)) {
+        if (can_establish_trade_route(homecity, pcity, pgood->replace_priority)) {
           fc_snprintf(cbuf, sizeof(cbuf),
                       _("%s With %s ( %d one time bonus + %d trade ) (R)"),
                       action_id_name_translation(ACTION_TRADE_ROUTE),
diff --git a/client/packhand.c b/client/packhand.c
index f99fc1c15d..fbc8cce45c 100644
--- a/client/packhand.c
+++ b/client/packhand.c
@@ -4361,7 +4361,7 @@ void handle_ruleset_goods(const struct packet_ruleset_goods *p)
   pgood->to_pct = p->to_pct;
   pgood->onetime_pct = p->onetime_pct;
   pgood->select_priority = p->select_priority;
-  pgood->priority = p->replace_priority;
+  pgood->replace_priority = p->replace_priority;
   pgood->flags = p->flags;
 
   PACKET_STRVEC_EXTRACT(pgood->helptext, p->helptext);
diff --git a/client/text.c b/client/text.c
index 1fb71803ca..9d50ee50ea 100644
--- a/client/text.c
+++ b/client/text.c
@@ -334,7 +334,7 @@ const char *popup_info_text(struct tile *ptile)
           && can_cities_trade(hcity, pcity)
           && can_establish_trade_route(hcity, pcity,
                                        unit_current_goods(pfocus_unit,
-                                                          hcity)->priority)) {
+                                                          hcity)->replace_priority)) {
         /* TRANS: "Trade from Warsaw: 5" */
         astr_add_line(&str, _("Trade from %s: %d"),
                       city_name_get(hcity),
diff --git a/common/actres.c b/common/actres.c
index 00d644510a..9f97429ac7 100644
--- a/common/actres.c
+++ b/common/actres.c
@@ -921,7 +921,7 @@ enum fc_tristate actres_possible(const struct civ_map *nmap,
         struct goods_type *pgood = unit_current_goods(actor->unit, homecity);
 
         if (!can_establish_trade_route(homecity, target->city,
-                                       pgood->priority)) {
+                                       pgood->replace_priority)) {
           return TRI_NO;
         }
       }
diff --git a/common/aicore/caravan.c b/common/aicore/caravan.c
index 888ce20469..9553156f1e 100644
--- a/common/aicore/caravan.c
+++ b/common/aicore/caravan.c
@@ -265,7 +265,7 @@ static double windfall_benefit(const struct unit *caravan,
   } else {
     bool can_establish = (unit_can_do_action(caravan, ACTION_TRADE_ROUTE)
                           && can_establish_trade_route(src, dest,
-                                                       pgood->priority));
+                                                       pgood->replace_priority));
     int bonus = get_caravan_enter_city_trade_bonus(src, dest,
                                                    unit_type_get(caravan),
                                                    NULL, can_establish);
@@ -305,8 +305,10 @@ static int one_city_trade_benefit(const struct city *pcity,
     /* If the city can handle this route, we don't break any old routes */
     losttrade = 0;
   } else {
-    struct trade_route_list *would_remove = (countloser ? trade_route_list_new() : NULL);
-    int oldtrade = city_trade_removable(pcity, pgood->priority, would_remove);
+    struct trade_route_list *would_remove
+      = (countloser ? trade_route_list_new() : NULL);
+    int oldtrade = city_trade_removable(pcity, pgood->replace_priority,
+                                        would_remove);
 
     /* If we own the city, the trade benefit is only by how much
        better we are than the old trade route */
@@ -354,7 +356,7 @@ static double trade_benefit(const struct player *caravan_owner,
 
   /* First, see if a new route is made. */
   if (!can_cities_trade(src, dest)
-      || !can_establish_trade_route(src, dest, pgood->priority)) {
+      || !can_establish_trade_route(src, dest, pgood->replace_priority)) {
     return 0;
   }
   if (max_trade_routes(src) <= 0 || max_trade_routes(dest) <= 0) {
diff --git a/common/traderoutes.c b/common/traderoutes.c
index e2676b8102..b971ae4549 100644
--- a/common/traderoutes.c
+++ b/common/traderoutes.c
@@ -237,13 +237,15 @@ int city_trade_removable(const struct city *pcity, int priority,
   /* Sort trade route values. */
   num = 0;
   trade_routes_iterate(pcity, proute) {
-    if (proute->goods->priority <= priority) {
-      for (j = num; j > 0 && proute->goods->priority > sorted[j - 1]->goods->priority; j--) ;
+    if (proute->goods->replace_priority <= priority) {
+      for (j = num;
+           j > 0 && proute->goods->replace_priority > sorted[j - 1]->goods->replace_priority;
+           j--) ;
 
       /* Search place amoung same priority ones. */
       for (; j > 0
              && (proute->value < sorted[j - 1]->value)
-             && (proute->goods->priority == sorted[j - 1]->goods->priority) ;
+             && (proute->goods->replace_priority == sorted[j - 1]->goods->replace_priority) ;
            j--) {
         sorted[j] = sorted[j - 1];
       }
diff --git a/common/traderoutes.h b/common/traderoutes.h
index a9631e56bb..362c8a9867 100644
--- a/common/traderoutes.h
+++ b/common/traderoutes.h
@@ -196,7 +196,7 @@ struct goods_type
   int onetime_pct;
 
   int select_priority;
-  int priority;
+  int replace_priority;
 
   bv_goods_flags flags;
 
diff --git a/data/alien/game.ruleset b/data/alien/game.ruleset
index 1df6f623c0..008a2b8d18 100644
--- a/data/alien/game.ruleset
+++ b/data/alien/game.ruleset
@@ -551,7 +551,7 @@ goods_selection = "Arrival"
 ; onetime_pct             = Onetime bonuses when trade route gets established. Default is 100%
 ; select_priority         = Available good with highest select_priority get selected for
 ;                           the traderoute, random among the same select_pririty.
-; priority                = Trade routes get replaced by higher priority goods, or higher
+; replace_priority        = Trade routes get replaced by higher priority goods, or higher
 ;                           trade value when priority is the same.
 ; flags
 ;   - "Bidirectional"     = Trade route carrying the goods does not have "from" and "to"
@@ -569,8 +569,8 @@ goods_selection = "Arrival"
 ; */ <-- avoid gettext warnings
 
 [goods_commodities]
-name           = _("Commodities")
-priority       = 1
+name             = _("Commodities")
+replace_priority = 1
 
 
 ; /* <-- avoid gettext warnings
diff --git a/data/civ1/game.ruleset b/data/civ1/game.ruleset
index 77840c7937..fd4eff9d47 100644
--- a/data/civ1/game.ruleset
+++ b/data/civ1/game.ruleset
@@ -583,7 +583,7 @@ goods_selection = "Arrival"
 ; onetime_pct             = Onetime bonuses when trade route gets established. Default is 100%
 ; select_priority         = Available good with highest select_priority get selected for
 ;                           the traderoute, random among the same select_pririty.
-; priority                = Trade routes get replaced by higher priority goods, or higher
+; replace_priority        = Trade routes get replaced by higher priority goods, or higher
 ;                           trade value when priority is the same.
 ; flags
 ;   - "Bidirectional"     = Trade route carrying the goods does not have "from" and "to"
@@ -601,9 +601,9 @@ goods_selection = "Arrival"
 ; */ <-- avoid gettext warnings
 
 [goods_good]
-name           = _("Goods")
-priority       = 1
-flags          = "Bidirectional"
+name             = _("Goods")
+replace_priority = 1
+flags            = "Bidirectional"
 
 
 ; /* <-- avoid gettext warnings
diff --git a/data/civ2/game.ruleset b/data/civ2/game.ruleset
index f2902abfd6..0c26fdc28b 100644
--- a/data/civ2/game.ruleset
+++ b/data/civ2/game.ruleset
@@ -514,7 +514,7 @@ goods_selection = "Arrival"
 ; onetime_pct             = Onetime bonuses when trade route gets established. Default is 100%
 ; select_priority         = Available good with highest select_priority get selected for
 ;                           the traderoute, random among the same select_pririty.
-; priority                = Trade routes get replaced by higher priority goods, or higher
+; replace_priority        = Trade routes get replaced by higher priority goods, or higher
 ;                           trade value when priority is the same.
 ; flags
 ;   - "Bidirectional"     = Trade route carrying the goods does not have "from" and "to"
@@ -532,9 +532,9 @@ goods_selection = "Arrival"
 ; */ <-- avoid gettext warnings
 
 [goods_good]
-name           = _("Goods")
-priority       = 1
-flags          = "Bidirectional"
+name             = _("Goods")
+replace_priority = 1
+flags            = "Bidirectional"
 
 
 ; /* <-- avoid gettext warnings
diff --git a/data/civ2civ3/game.ruleset b/data/civ2civ3/game.ruleset
index 72497079e9..1def4c43e1 100644
--- a/data/civ2civ3/game.ruleset
+++ b/data/civ2civ3/game.ruleset
@@ -653,7 +653,7 @@ goods_selection = "Leaving"
 ; onetime_pct             = Onetime bonuses when trade route gets established. Default is 100%
 ; select_priority         = Available good with highest select_priority get selected for
 ;                           the traderoute, random among the same select_pririty.
-; priority                = Trade routes get replaced by higher priority goods, or higher
+; replace_priority        = Trade routes get replaced by higher priority goods, or higher
 ;                           trade value when priority is the same.
 ; flags
 ;   - "Bidirectional"     = Trade route carrying the goods does not have "from" and "to"
@@ -671,8 +671,8 @@ goods_selection = "Leaving"
 ; */ <-- avoid gettext warnings
 
 [goods_good]
-name           = _("Goods")
-priority       = 1
+name             = _("Goods")
+replace_priority = 1
 
 ; /* <-- avoid gettext warnings
 ;
diff --git a/data/classic/game.ruleset b/data/classic/game.ruleset
index 169ccae33a..f4aeea1838 100644
--- a/data/classic/game.ruleset
+++ b/data/classic/game.ruleset
@@ -566,7 +566,7 @@ goods_selection = "Arrival"
 ; onetime_pct             = Onetime bonuses when trade route gets established. Default is 100%
 ; select_priority         = Available good with highest select_priority get selected for
 ;                           the traderoute, random among the same select_pririty.
-; priority                = Trade routes get replaced by higher priority goods, or higher
+; replace_priority        = Trade routes get replaced by higher priority goods, or higher
 ;                           trade value when priority is the same.
 ; flags
 ;   - "Bidirectional"     = Trade route carrying the goods does not have "from" and "to"
@@ -584,8 +584,8 @@ goods_selection = "Arrival"
 ; */ <-- avoid gettext warnings
 
 [goods_good]
-name           = _("Goods")
-priority       = 1
+name             = _("Goods")
+replace_priority = 1
 
 
 ; /* <-- avoid gettext warnings
diff --git a/data/goldkeep/game.ruleset b/data/goldkeep/game.ruleset
index 64c7183d95..706fdad4f0 100644
--- a/data/goldkeep/game.ruleset
+++ b/data/goldkeep/game.ruleset
@@ -584,7 +584,7 @@ goods_selection = "Leaving"
 ; onetime_pct             = Onetime bonuses when trade route gets established. Default is 100%
 ; select_priority         = Available good with highest select_priority get selected for
 ;                           the traderoute, random among the same select_pririty.
-; priority                = Trade routes get replaced by higher priority goods, or higher
+; replace_priority        = Trade routes get replaced by higher priority goods, or higher
 ;                           trade value when priority is the same.
 ; flags
 ;   - "Bidirectional"     = Trade route carrying the goods does not have "from" and "to"
@@ -602,8 +602,8 @@ goods_selection = "Leaving"
 ; */ <-- avoid gettext warnings
 
 [goods_good]
-name           = _("Goods")
-priority       = 1
+name             = _("Goods")
+replace_priority = 1
 
 
 ; /* <-- avoid gettext warnings
diff --git a/data/granularity/game.ruleset b/data/granularity/game.ruleset
index 99f6aa9924..791a4d26fd 100644
--- a/data/granularity/game.ruleset
+++ b/data/granularity/game.ruleset
@@ -538,7 +538,7 @@ goods_selection = "Leaving"
 ; onetime_pct             = Onetime bonuses when trade route gets established. Default is 100%
 ; select_priority         = Available good with highest select_priority get selected for
 ;                           the traderoute, random among the same select_pririty.
-; priority                = Trade routes get replaced by higher priority goods, or higher
+; replace_priority        = Trade routes get replaced by higher priority goods, or higher
 ;                           trade value when priority is the same.
 ; flags
 ;   - "Bidirectional"     = Trade route carrying the goods does not have "from" and "to"
@@ -556,8 +556,8 @@ goods_selection = "Leaving"
 ; */ <-- avoid gettext warnings
 
 [goods_good]
-name           = _("Goods")
-priority       = 1
+name             = _("Goods")
+replace_priority = 1
 
 
 ; /* <-- avoid gettext warnings
diff --git a/data/multiplayer/game.ruleset b/data/multiplayer/game.ruleset
index 4a5852d69f..e81327cec3 100644
--- a/data/multiplayer/game.ruleset
+++ b/data/multiplayer/game.ruleset
@@ -533,7 +533,7 @@ goods_selection = "Arrival"
 ; onetime_pct             = Onetime bonuses when trade route gets established. Default is 100%
 ; select_priority         = Available good with highest select_priority get selected for
 ;                           the traderoute, random among the same select_pririty.
-; priority                = Trade routes get replaced by higher priority goods, or higher
+; replace_priority        = Trade routes get replaced by higher priority goods, or higher
 ;                           trade value when priority is the same.
 ; flags
 ;   - "Bidirectional"     = Trade route carrying the goods does not have "from" and "to"
@@ -551,8 +551,8 @@ goods_selection = "Arrival"
 ; */ <-- avoid gettext warnings
 
 [goods_good]
-name           = _("Goods")
-priority       = 1
+name             = _("Goods")
+replace_priority = 1
 
 ; /* <-- avoid gettext warnings
 ;
diff --git a/data/ruledit/comments-3.3.txt b/data/ruledit/comments-3.3.txt
index 6bb3637a5e..7557f7a0e7 100644
--- a/data/ruledit/comments-3.3.txt
+++ b/data/ruledit/comments-3.3.txt
@@ -1128,7 +1128,7 @@ goods = "\
 ; onetime_pct             = Onetime bonuses when trade route gets established. Default is 100\%\n\
 ; select_priority         = Available good with highest select_priority get selected for\n\
 ;                           the traderoute, random among the same select_pririty.\n\
-; priority                = Trade routes get replaced by higher priority goods, or higher\n\
+; replace_priority        = Trade routes get replaced by higher priority goods, or higher\n\
 ;                           trade value when priority is the same.\n\
 ; flags\n\
 ;   - \"Bidirectional\"     = Trade route carrying the goods does not have \"from\" and \"to\"\n\
diff --git a/data/sandbox/game.ruleset b/data/sandbox/game.ruleset
index 857e1e74be..cf062f46ee 100644
--- a/data/sandbox/game.ruleset
+++ b/data/sandbox/game.ruleset
@@ -651,7 +651,7 @@ goods_selection = "Leaving"
 ; onetime_pct             = Onetime bonuses when trade route gets established. Default is 100%
 ; select_priority         = Available good with highest select_priority get selected for
 ;                           the traderoute, random among the same select_pririty.
-; priority                = Trade routes get replaced by higher priority goods, or higher
+; replace_priority        = Trade routes get replaced by higher priority goods, or higher
 ;                           trade value when priority is the same.
 ; flags
 ;   - "Bidirectional"     = Trade route carrying the goods does not have "from" and "to"
@@ -669,86 +669,86 @@ goods_selection = "Leaving"
 ; */ <-- avoid gettext warnings
 
 [goods_wares]
-name           = _("Wares")
-priority       = 1
-flags          = "Bidirectional"
+name             = _("Wares")
+replace_priority = 1
+flags            = "Bidirectional"
 
 [goods_spice]
-name           = _("Spice")
-priority       = 1
+name             = _("Spice")
+replace_priority = 1
 reqs =
     { "type", "name", "range"
       "Extra", "Spice", "City"
     }
-from_pct       = 135
-to_pct         = 100
-flags          = "Depletes"
+from_pct         = 135
+to_pct           = 100
+flags            = "Depletes"
 
 [goods_gems]
-name           = _("Gems")
-priority       = 1
+name             = _("Gems")
+replace_priority = 1
 reqs =
     { "type", "name", "range"
       "Extra", "Gems", "City"
     }
-from_pct       = 135
-to_pct         = 100
-flags          = "Depletes"
+from_pct         = 135
+to_pct           = 100
+flags            = "Depletes"
 
 [goods_jewelry]
-name           = _("Jewelry")
-priority       = 1
+name             = _("Jewelry")
+replace_priority = 1
 reqs =
     { "type", "name", "range"
       "Good", "Gems", "City"
     }
-from_pct       = 250
-to_pct         = 150
-flags          = "Depletes"
+from_pct         = 250
+to_pct           = 150
+flags            = "Depletes"
 
 [goods_ore]
-name           = _("Ore")
-priority       = 1
+name             = _("Ore")
+replace_priority = 1
 reqs =
     { "type", "name", "range"
       "Extra", "Mine", "City"
     }
-flags          = "Depletes"
+flags            = "Depletes"
 
 [goods_metal]
-name           = _("Metal")
-priority       = 1
+name             = _("Metal")
+replace_priority = 1
 reqs =
     { "type", "name", "range"
       "Good", "Ore", "City"
     }
-from_pct       = 135
-to_pct         = 100
-flags          = "Depletes"
+from_pct         = 135
+to_pct           = 100
+flags            = "Depletes"
 
 [goods_good]
-name           = _("Goods")
-priority       = 1
+name             = _("Goods")
+replace_priority = 1
 reqs =
     { "type", "name", "range", "present"
       "Good", "Metal", "City", TRUE
       "Tech", "Electronics", "Player", FALSE
     }
-from_pct       = 150
-to_pct         = 135
-flags          = "Depletes"
+from_pct         = 150
+to_pct           = 135
+flags            = "Depletes"
 
 [goods_equipment]
-name           = _("Equipment")
-priority       = 1
+name             = _("Equipment")
+replace_priority = 1
 reqs =
     { "type", "name", "range"
       "Good", "Metal", "City"
       "Tech", "Electronics", "Player"
     }
-from_pct       = 200
-to_pct         = 150
-flags          = "Depletes"
+from_pct         = 200
+to_pct           = 150
+flags            = "Depletes"
 
 
 ; /* <-- avoid gettext warnings
diff --git a/data/stub/game.ruleset b/data/stub/game.ruleset
index dfb99f7d78..5156c8e303 100644
--- a/data/stub/game.ruleset
+++ b/data/stub/game.ruleset
@@ -526,7 +526,7 @@ goods_selection = "Leaving"
 ; onetime_pct             = Onetime bonuses when trade route gets established. Default is 100%
 ; select_priority         = Available good with highest select_priority get selected for
 ;                           the traderoute, random among the same select_pririty.
-; priority                = Trade routes get replaced by higher priority goods, or higher
+; replace_priority        = Trade routes get replaced by higher priority goods, or higher
 ;                           trade value when priority is the same.
 ; flags
 ;   - "Bidirectional"     = Trade route carrying the goods does not have "from" and "to"
@@ -544,8 +544,8 @@ goods_selection = "Leaving"
 ; */ <-- avoid gettext warnings
 
 [goods_good]
-name           = _("Goods")
-priority       = 1
+name             = _("Goods")
+replace_priority = 1
 
 
 ; /* <-- avoid gettext warnings
diff --git a/data/webperimental/game.ruleset b/data/webperimental/game.ruleset
index 52acb06d6c..27256acc1b 100644
--- a/data/webperimental/game.ruleset
+++ b/data/webperimental/game.ruleset
@@ -570,7 +570,7 @@ goods_selection = "Leaving"
 ; onetime_pct             = Onetime bonuses when trade route gets established. Default is 100%
 ; select_priority         = Available good with highest select_priority get selected for
 ;                           the traderoute, random among the same select_pririty.
-; priority                = Trade routes get replaced by higher priority goods, or higher
+; replace_priority        = Trade routes get replaced by higher priority goods, or higher
 ;                           trade value when priority is the same.
 ; flags
 ;   - "Bidirectional"     = Trade route carrying the goods does not have "from" and "to"
@@ -588,8 +588,8 @@ goods_selection = "Leaving"
 ; */ <-- avoid gettext warnings
 
 [goods_good]
-name           = _("Goods")
-priority       = 1
+name             = _("Goods")
+replace_priority = 1
 
 
 ; /* <-- avoid gettext warnings
diff --git a/server/citytools.c b/server/citytools.c
index 985ac21d37..d9332656e7 100644
--- a/server/citytools.c
+++ b/server/citytools.c
@@ -966,7 +966,7 @@ static void reestablish_city_trade_routes(struct city *pcity)
     back = remove_trade_route(pcity, proute, FALSE, FALSE);
 
     keep_route = can_cities_trade(pcity, partner)
-      && can_establish_trade_route(pcity, partner, proute->goods->priority);
+      && can_establish_trade_route(pcity, partner, proute->goods->replace_priority);
 
     if (!keep_route) {
       enum trade_route_type type = cities_trade_route_type(pcity, partner);
diff --git a/server/ruleset/ruleload.c b/server/ruleset/ruleload.c
index 2ca2604b4f..8cae8abfd9 100644
--- a/server/ruleset/ruleload.c
+++ b/server/ruleset/ruleload.c
@@ -7416,8 +7416,8 @@ static bool load_ruleset_game(struct section_file *file, bool act,
                                                       "%s.onetime_pct", sec_name);
       pgood->select_priority = secfile_lookup_int_default(file, 1,
                                                           "%s.select_priority", sec_name);
-      pgood->priority = secfile_lookup_int_default(file, 1,
-                                                   "%s.priority", sec_name);
+      pgood->replace_priority = secfile_lookup_int_default(file, 1,
+                                                           "%s.replace_priority", sec_name);
 
       slist = secfile_lookup_str_vec(file, &nval, "%s.flags", sec_name);
       BV_CLR_ALL(pgood->flags);
@@ -8600,7 +8600,7 @@ static void send_ruleset_goods(struct conn_list *dest)
     packet.to_pct = g->to_pct;
     packet.onetime_pct = g->onetime_pct;
     packet.select_priority = g->select_priority;
-    packet.replace_priority = g->priority;
+    packet.replace_priority = g->replace_priority;
     packet.flags = g->flags;
 
     PACKET_STRVEC_INSERT(packet.helptext, g->helptext);
diff --git a/server/unithand.c b/server/unithand.c
index 9ef262dbe2..d100caf19b 100644
--- a/server/unithand.c
+++ b/server/unithand.c
@@ -6061,7 +6061,8 @@ static bool do_unit_establish_trade(struct player *pplayer,
     /* See if there's a trade route we can cancel at the home city. */
     if (home_overbooked >= 0) {
       if (home_max <= 0
-          || (city_trade_removable(pcity_homecity, goods->priority, routes_out_of_home)
+          || (city_trade_removable(pcity_homecity, goods->replace_priority,
+                                   routes_out_of_home)
               >= trade)) {
         notify_player(pplayer, city_tile(pcity_dest),
                       E_BAD_COMMAND, ftc_server,
@@ -6085,7 +6086,8 @@ static bool do_unit_establish_trade(struct player *pplayer,
     /* See if there's a trade route we can cancel at the dest city. */
     if (can_establish && dest_overbooked >= 0) {
       if (dest_max <= 0
-          || (city_trade_removable(pcity_dest, goods->priority, routes_out_of_dest)
+          || (city_trade_removable(pcity_dest, goods->replace_priority,
+                                   routes_out_of_dest)
               >= trade)) {
         notify_player(pplayer, city_tile(pcity_dest),
                       E_BAD_COMMAND, ftc_server,
diff --git a/tools/ruleutil/rulesave.c b/tools/ruleutil/rulesave.c
index 0397c98c06..d51d1f6cc6 100644
--- a/tools/ruleutil/rulesave.c
+++ b/tools/ruleutil/rulesave.c
@@ -1777,7 +1777,7 @@ static bool save_game_ruleset(const char *filename, const char *name)
     save_default_int(sfile, pgood->to_pct, 100, path, "to_pct");
     save_default_int(sfile, pgood->onetime_pct, 100, path, "onetime_pct");
     save_default_int(sfile, pgood->select_priority, 1, path, "select_priority");
-    save_default_int(sfile, pgood->priority, 1, path, "priority");
+    save_default_int(sfile, pgood->replace_priority, 1, path, "replace_priority");
 
     set_count = 0;
     for (flagi = 0; flagi < GF_COUNT; flagi++) {
-- 
2.43.0

