From 7859dbe3281dc4780d11aab9b0eb2144a662ad32 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Wed, 13 Mar 2024 17:27:30 +0200 Subject: [PATCH 1/3] Update to Freeciv server freeciv/freeciv@32144618d6 Signed-off-by: Marko Lindqvist --- .../src/main/webapp/javascript/fc_types.js | 36 ++++++++++--------- freeciv/version.txt | 4 +-- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/freeciv-web/src/main/webapp/javascript/fc_types.js b/freeciv-web/src/main/webapp/javascript/fc_types.js index 44a135d9d..15e4e1f73 100644 --- a/freeciv-web/src/main/webapp/javascript/fc_types.js +++ b/freeciv-web/src/main/webapp/javascript/fc_types.js @@ -265,24 +265,26 @@ var ACTION_TELEPORT = 112; var ACTION_TELEPORT2 = 113; var ACTION_TELEPORT3 = 114; var ACTION_TELEPORT_CONQUER = 115; -var ACTION_TELEPORT_ENTER = 116; -var ACTION_TELEPORT_ENTER_CONQUER = 117; -var ACTION_CLEAN = 118; -var ACTION_COLLECT_RANSOM = 119; -var ACTION_FORTIFY = 120; -var ACTION_CULTIVATE = 121; -var ACTION_CULTIVATE2 = 122; -var ACTION_PLANT = 123; -var ACTION_PLANT2 = 124; -var ACTION_TRANSFORM_TERRAIN = 125; -var ACTION_TRANSFORM_TERRAIN2 = 126; +var ACTION_TELEPORT_FRIGHTEN = 116; +var ACTION_TELEPORT_FRIGHTEN_CONQUER = 117; +var ACTION_TELEPORT_ENTER = 118; +var ACTION_TELEPORT_ENTER_CONQUER = 119; +var ACTION_CLEAN = 120; +var ACTION_COLLECT_RANSOM = 121; +var ACTION_FORTIFY = 122; +var ACTION_CULTIVATE = 123; +var ACTION_CULTIVATE2 = 124; +var ACTION_PLANT = 125; +var ACTION_PLANT2 = 126; +var ACTION_TRANSFORM_TERRAIN = 127; +var ACTION_TRANSFORM_TERRAIN2 = 128; -var ACTION_GAIN_VETERANCY = 127; -var ACTION_USER_ACTION1 = 128; -var ACTION_USER_ACTION2 = 129; -var ACTION_USER_ACTION3 = 130; -var ACTION_USER_ACTION4 = 131; -var ACTION_COUNT = 132; +var ACTION_GAIN_VETERANCY = 129; +var ACTION_USER_ACTION1 = 130; +var ACTION_USER_ACTION2 = 131; +var ACTION_USER_ACTION3 = 132; +var ACTION_USER_ACTION4 = 133; +var ACTION_COUNT = 134; /* The action_decision enum */ /* Doesn't need the player to decide what action to take. */ diff --git a/freeciv/version.txt b/freeciv/version.txt index 2c86084fc..d12153933 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=dbc33c19ab3b545d406d266e606c5007ad2ce2b6 +FCREV=32144618d616cd7dabb191cb7c05f2bc83ab69d9 -ORIGCAPSTR="+Freeciv.Devel-\${MAIN_VERSION}-2024.Jan.22" +ORIGCAPSTR="+Freeciv.Devel-\${MAIN_VERSION}-2024.Jan.26" # There's no need to bump this constantly as current freeciv-web # makes no connections to outside world - all connections are From fe0d6395996063cf72ed7cbd21c523329bb7d44a Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Wed, 13 Mar 2024 17:56:03 +0200 Subject: [PATCH 2/3] Server: Backport 0023-Fix-activity2char-assert-failure.patch Signed-off-by: Marko Lindqvist --- freeciv/apply_patches.sh | 4 +++ ...023-Fix-activity2char-assert-failure.patch | 36 +++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 freeciv/patches/backports/0023-Fix-activity2char-assert-failure.patch diff --git a/freeciv/apply_patches.sh b/freeciv/apply_patches.sh index d05a2501e..6bcd67e15 100755 --- a/freeciv/apply_patches.sh +++ b/freeciv/apply_patches.sh @@ -15,6 +15,9 @@ # 0023-Improve-connecthand.-ch-coding-style.patch # Set baseline for freeciv-web patches # RM #264 +# 0023-Fix-activity2char-assert-failure.patch +# Savegame loading fix +# RM #305 # Not in the upstream Freeciv server # ---------------------------------- @@ -41,6 +44,7 @@ declare -a PATCHLIST=( "backports/0037-Correct-action_post_success_forced_ruleset_var_name-" "backports/0046-Fix-auto_arrange_workers-garbage-cmp.minimal_surplus" "backports/0023-Improve-connecthand.-ch-coding-style" + "backports/0023-Fix-activity2char-assert-failure" "RevertAmplio2ExtraUnits" "meson_webperimental" "metachange" diff --git a/freeciv/patches/backports/0023-Fix-activity2char-assert-failure.patch b/freeciv/patches/backports/0023-Fix-activity2char-assert-failure.patch new file mode 100644 index 000000000..54dbe855e --- /dev/null +++ b/freeciv/patches/backports/0023-Fix-activity2char-assert-failure.patch @@ -0,0 +1,36 @@ +From 8b63f65072bfe597db1d44db32728611c0b7a1a0 Mon Sep 17 00:00:00 2001 +From: Marko Lindqvist +Date: Wed, 13 Mar 2024 02:48:32 +0200 +Subject: [PATCH 23/24] Fix activity2char() assert failure + +See RM #305 + +Signed-off-by: Marko Lindqvist +--- + server/savegame/savegame3.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/server/savegame/savegame3.c b/server/savegame/savegame3.c +index e7d633419b..a3aefeeb49 100644 +--- a/server/savegame/savegame3.c ++++ b/server/savegame/savegame3.c +@@ -876,10 +876,13 @@ static enum unit_activity char2activity(char activity) + enum unit_activity a; + + for (a = 0; a < ACTIVITY_LAST_SAVEGAME3; a++) { +- char achar = activity2char(a); ++ /* Skip ACTIVITY_LAST. The SAVEGAME3 specific values are after it. */ ++ if (a != ACTIVITY_LAST) { ++ char achar = activity2char(a); + +- if (activity == achar) { +- return a; ++ if (activity == achar) { ++ return a; ++ } + } + } + +-- +2.43.0 + From 35b16aa2cbd081f5bb9d8bd389fb8bd9d5614596 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Wed, 13 Mar 2024 22:15:26 +0200 Subject: [PATCH 3/3] Server: Backport 0025-Purge-worklist-items-with-unfulfilled-local-range-im.patch Signed-off-by: Marko Lindqvist --- freeciv/apply_patches.sh | 4 ++ ...tems-with-unfulfilled-local-range-im.patch | 47 +++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 freeciv/patches/backports/0025-Purge-worklist-items-with-unfulfilled-local-range-im.patch diff --git a/freeciv/apply_patches.sh b/freeciv/apply_patches.sh index 6bcd67e15..f392a96b5 100755 --- a/freeciv/apply_patches.sh +++ b/freeciv/apply_patches.sh @@ -18,6 +18,9 @@ # 0023-Fix-activity2char-assert-failure.patch # Savegame loading fix # RM #305 +# 0025-Purge-worklist-items-with-unfulfilled-local-range-im.patch +# Worklist handling fix +# osdn #48773 # Not in the upstream Freeciv server # ---------------------------------- @@ -45,6 +48,7 @@ declare -a PATCHLIST=( "backports/0046-Fix-auto_arrange_workers-garbage-cmp.minimal_surplus" "backports/0023-Improve-connecthand.-ch-coding-style" "backports/0023-Fix-activity2char-assert-failure" + "backports/0025-Purge-worklist-items-with-unfulfilled-local-range-im" "RevertAmplio2ExtraUnits" "meson_webperimental" "metachange" diff --git a/freeciv/patches/backports/0025-Purge-worklist-items-with-unfulfilled-local-range-im.patch b/freeciv/patches/backports/0025-Purge-worklist-items-with-unfulfilled-local-range-im.patch new file mode 100644 index 000000000..d90a987ca --- /dev/null +++ b/freeciv/patches/backports/0025-Purge-worklist-items-with-unfulfilled-local-range-im.patch @@ -0,0 +1,47 @@ +From a612446f31fa2a4e281fc6943fda755af3f34e42 Mon Sep 17 00:00:00 2001 +From: Marko Lindqvist +Date: Wed, 13 Mar 2024 19:32:41 +0200 +Subject: [PATCH 25/25] Purge worklist items with unfulfilled local range impr + reqs + +See osdn #48773 + +Signed-off-by: Marko Lindqvist +--- + server/cityturn.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/server/cityturn.c b/server/cityturn.c +index a05034ba97..da0f5e3ee6 100644 +--- a/server/cityturn.c ++++ b/server/cityturn.c +@@ -1260,7 +1260,7 @@ static bool worklist_item_postpone_req_vec(struct universal *target, + case VUT_IMPROVEMENT: + if (preq->range == REQ_RANGE_LOCAL) { + /* Building itself is never going to change */ +- purge = FALSE; ++ purge = TRUE; + } else { + if (preq->present) { + notify_player(pplayer, city_tile(pcity), +@@ -1290,7 +1290,7 @@ static bool worklist_item_postpone_req_vec(struct universal *target, + case VUT_IMPR_GENUS: + if (preq->range == REQ_RANGE_LOCAL) { + /* Building's own genus is never going to change */ +- purge = FALSE; ++ purge = TRUE; + } else { + if (preq->present) { + notify_player(pplayer, city_tile(pcity), +@@ -1320,7 +1320,7 @@ static bool worklist_item_postpone_req_vec(struct universal *target, + case VUT_IMPR_FLAG: + if (preq->range == REQ_RANGE_LOCAL) { + /* Building's own flags are never going to change */ +- purge = FALSE; ++ purge = TRUE; + } else { + if (preq->present) { + notify_player(pplayer, city_tile(pcity), +-- +2.43.0 +