From 957b1f99a23db52f4a899c9e7a4ebb4a8570608e Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Thu, 25 Apr 2024 05:58:58 +0300 Subject: [PATCH] Update to Freeciv server freeciv/freeciv@579ebb52b9 Signed-off-by: Marko Lindqvist --- freeciv/apply_patches.sh | 8 +-- .../0046-Fix-freeciv-web-build.patch | 36 ++++++++++++ ...ty-of-remaining-units-after-player-r.patch | 56 ------------------- freeciv/version.txt | 4 +- 4 files changed, 42 insertions(+), 62 deletions(-) create mode 100644 freeciv/patches/backports/0046-Fix-freeciv-web-build.patch delete mode 100644 freeciv/patches/backports/0051-Adjust-nationality-of-remaining-units-after-player-r.patch diff --git a/freeciv/apply_patches.sh b/freeciv/apply_patches.sh index 3408dcb91..34a5bbc26 100755 --- a/freeciv/apply_patches.sh +++ b/freeciv/apply_patches.sh @@ -6,15 +6,15 @@ # https://osdn.net/projects/freeciv/ticket/????? # https://redmine.freeciv.org/issues/??? # -# 0051-Adjust-nationality-of-remaining-units-after-player-r.patch -# Fix to player removal -# RM #383 # 0038-AI-Delay-war-declaration-until-really-revolted.patch # AI senate dismissal fix # osdn #48018 # 0053-AI-Fix-bad-city-spot-value-calculation-with-unknown-.patch # AI city spot evaluation fix # RM #408 +# 0046-Fix-freeciv-web-build.patch +# Freeciv-web build fix +# RM #435 # 0034-update_bulbs-Fix-research-researching_saved-research.patch # Fix to research assert failure # RM #449 @@ -56,9 +56,9 @@ declare -a GIT_PATCHLIST=( ) declare -a PATCHLIST=( - "backports/0051-Adjust-nationality-of-remaining-units-after-player-r" "backports/0038-AI-Delay-war-declaration-until-really-revolted" "backports/0053-AI-Fix-bad-city-spot-value-calculation-with-unknown-" + "backports/0046-Fix-freeciv-web-build" "backports/0034-update_bulbs-Fix-research-researching_saved-research" "backports/0050-Initialize-extra-before-calling-unit_assign_specific" "backports/0050-savegame-Fix-loading-invalid-resources-on-FoW-map" diff --git a/freeciv/patches/backports/0046-Fix-freeciv-web-build.patch b/freeciv/patches/backports/0046-Fix-freeciv-web-build.patch new file mode 100644 index 000000000..da1f0b562 --- /dev/null +++ b/freeciv/patches/backports/0046-Fix-freeciv-web-build.patch @@ -0,0 +1,36 @@ +From 08477c234f5f05120116a3901ea87964368b62b3 Mon Sep 17 00:00:00 2001 +From: Marko Lindqvist +Date: Wed, 10 Apr 2024 03:29:33 +0300 +Subject: [PATCH 46/47] Fix freeciv-web build + +See RM #435 + +Signed-off-by: Marko Lindqvist +--- + server/citytools.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/server/citytools.c b/server/citytools.c +index 03430daa79..24fc2bad71 100644 +--- a/server/citytools.c ++++ b/server/citytools.c +@@ -2689,6 +2689,7 @@ void package_city(struct city *pcity, struct packet_city_info *packet, + #ifdef FREECIV_WEB + if (web_packet != nullptr) { + struct tile *pcenter = city_tile(pcity); ++ const struct civ_map *nmap = &(wld.map); + + BV_CLR_ALL(web_packet->can_build_unit); + BV_CLR_ALL(web_packet->can_build_improvement); +@@ -2719,7 +2720,7 @@ void package_city(struct city *pcity, struct packet_city_info *packet, + } unit_type_iterate_end; + + i = 0; +- city_tile_iterate(city_map_radius_sq_get(pcity), pcenter, ptile) { ++ city_tile_iterate(nmap, city_map_radius_sq_get(pcity), pcenter, ptile) { + web_packet->output_food[i] = city_tile_output_now(pcity, ptile, O_FOOD); + web_packet->output_shield[i] = city_tile_output_now(pcity, ptile, O_SHIELD); + web_packet->output_trade[i] = city_tile_output_now(pcity, ptile, O_TRADE); +-- +2.43.0 + diff --git a/freeciv/patches/backports/0051-Adjust-nationality-of-remaining-units-after-player-r.patch b/freeciv/patches/backports/0051-Adjust-nationality-of-remaining-units-after-player-r.patch deleted file mode 100644 index c42c3ae61..000000000 --- a/freeciv/patches/backports/0051-Adjust-nationality-of-remaining-units-after-player-r.patch +++ /dev/null @@ -1,56 +0,0 @@ -From d9e61b2de945fc3cb8f934c6b514f5b4f441b1bd Mon Sep 17 00:00:00 2001 -From: Marko Lindqvist -Date: Sun, 31 Mar 2024 18:34:19 +0300 -Subject: [PATCH 51/57] Adjust nationality of remaining units after player - removal - -Nationality of the units owned by other players could -previously be that of removed player, leading to a crash. -Now switch nationality of such units to that of their -current owner when player of their nationality is removed. - -See RM #383 - -Signed-off-by: Marko Lindqvist ---- - common/player.c | 17 +++++++++++++++-- - 1 file changed, 15 insertions(+), 2 deletions(-) - -diff --git a/common/player.c b/common/player.c -index d539a79dad..209b9c6571 100644 ---- a/common/player.c -+++ b/common/player.c -@@ -659,8 +659,12 @@ void player_set_color(struct player *pplayer, - } - - /*******************************************************************//** -- Clear all player data. If full is set, then the nation and the team will -- be cleared too. -+ Clear all player data. -+ -+ If full is set, also -+ - The nation is cleared -+ - The team is cleared -+ - Nationality information of remaining units is adjusted - ***********************************************************************/ - void player_clear(struct player *pplayer, bool full) - { -@@ -717,6 +721,15 @@ void player_clear(struct player *pplayer, bool full) - if (full) { - team_remove_player(pplayer); - -+ players_iterate_alive(owner) { -+ unit_list_iterate(owner->units, owned) { -+ if (unit_nationality(owned) == pplayer) { -+ /* Switch nationality to that of current owner. */ -+ owned->nationality = owner; -+ } -+ } unit_list_iterate_end; -+ } players_iterate_alive_end; -+ - /* This comes last because log calls in the above functions - * may use it. */ - if (pplayer->nation != NULL) { --- -2.43.0 - diff --git a/freeciv/version.txt b/freeciv/version.txt index 01f8c2a60..90881a7ec 100644 --- a/freeciv/version.txt +++ b/freeciv/version.txt @@ -1,9 +1,9 @@ # The Git SHA hash for the commit to checkout from # https://github.com/freeciv/freeciv -FCREV=df12a279ddc417a964a8a9da0c4fc373a1981ca7 +FCREV=579ebb52b9ba166efe898cd864f058ab2a1bbcbb -ORIGCAPSTR="+Freeciv.Devel-\${MAIN_VERSION}-2024.Apr.07" +ORIGCAPSTR="+Freeciv.Devel-\${MAIN_VERSION}-2024.Apr.09" # There's no need to bump this constantly as current freeciv-web # makes no connections to outside world - all connections are