Skip to content

Commit

Permalink
Merge pull request #821 from cazfi/srvup
Browse files Browse the repository at this point in the history
  • Loading branch information
cazfi authored Mar 20, 2024
2 parents fd8579e + 35b16aa commit db1a5e5
Show file tree
Hide file tree
Showing 5 changed files with 112 additions and 19 deletions.
36 changes: 19 additions & 17 deletions freeciv-web/src/main/webapp/javascript/fc_types.js
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
8 changes: 8 additions & 0 deletions freeciv/apply_patches.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
# 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
# 0025-Purge-worklist-items-with-unfulfilled-local-range-im.patch
# Worklist handling fix
# osdn #48773

# Not in the upstream Freeciv server
# ----------------------------------
Expand All @@ -41,6 +47,8 @@ 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"
"backports/0025-Purge-worklist-items-with-unfulfilled-local-range-im"
"RevertAmplio2ExtraUnits"
"meson_webperimental"
"metachange"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
From 8b63f65072bfe597db1d44db32728611c0b7a1a0 Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <[email protected]>
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 <[email protected]>
---
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

Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
From a612446f31fa2a4e281fc6943fda755af3f34e42 Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <[email protected]>
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 <[email protected]>
---
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

4 changes: 2 additions & 2 deletions freeciv/version.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit db1a5e5

Please sign in to comment.