diff --git a/freeciv/apply_patches.sh b/freeciv/apply_patches.sh index 94af1889d..0e45e185e 100755 --- a/freeciv/apply_patches.sh +++ b/freeciv/apply_patches.sh @@ -35,6 +35,9 @@ # 0050-Correct-filling-of-territory-claiming-extras-cache.patch # Fix terr claiming extras cache # osdn #48838 +# 0025-Autoworkers-Use-ADV_WANTS_EQ-for-comparing-tile-valu.patch +# Autoworkers work value fix +# osdn #48842 # Not in the upstream Freeciv server # ---------------------------------- @@ -67,6 +70,7 @@ declare -a PATCHLIST=( "backports/0064-featured_text.-ch-Replace-NULL-with-nullptr" "backports/0050-Cache-territory-claiming-base-types" "backports/0050-Correct-filling-of-territory-claiming-extras-cache" + "backports/0025-Autoworkers-Use-ADV_WANTS_EQ-for-comparing-tile-valu" "meson_webperimental" "metachange" "text_fixes" diff --git a/freeciv/patches/backports/0025-Autoworkers-Use-ADV_WANTS_EQ-for-comparing-tile-valu.patch b/freeciv/patches/backports/0025-Autoworkers-Use-ADV_WANTS_EQ-for-comparing-tile-valu.patch new file mode 100644 index 000000000..72ec1c545 --- /dev/null +++ b/freeciv/patches/backports/0025-Autoworkers-Use-ADV_WANTS_EQ-for-comparing-tile-valu.patch @@ -0,0 +1,38 @@ +From 7a363dfc060e5aaeef57db560d00785bf92ea50a Mon Sep 17 00:00:00 2001 +From: Marko Lindqvist +Date: Fri, 13 Oct 2023 01:56:36 +0300 +Subject: [PATCH 25/32] Autoworkers: Use ADV_WANTS_EQ() for comparing tile + values + +See osdn #48842 + +Signed-off-by: Marko Lindqvist +--- + server/advisors/autoworkers.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/server/advisors/autoworkers.c b/server/advisors/autoworkers.c +index a875cabcfe..c8a10a1ff1 100644 +--- a/server/advisors/autoworkers.c ++++ b/server/advisors/autoworkers.c +@@ -335,7 +335,7 @@ static void consider_worker_action(const struct player *pplayer, + + if (new_tile_value > old_tile_value) { + improves = TRUE; +- } else if (new_tile_value == old_tile_value && extra > 0) { ++ } else if (ADV_WANTS_EQ(new_tile_value, old_tile_value) && extra > 0) { + improves = TRUE; + } else { + improves = FALSE; +@@ -386,7 +386,7 @@ static void consider_worker_action(const struct player *pplayer, + } + + if (total_value > old_improvement_value +- || (total_value == old_improvement_value ++ || (ADV_WANTS_EQ(total_value, old_improvement_value) + && old_tile_value > *best_old_tile_value)) { + if (in_use) { + *best_value = total_value; +-- +2.42.0 +