Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Srvup #844

Merged
merged 2 commits into from
May 14, 2024
Merged

Srvup #844

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions freeciv/apply_patches.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
# https://osdn.net/projects/freeciv/ticket/?????
# https://redmine.freeciv.org/issues/???
#
# 0038-AI-Delay-war-declaration-until-really-revolted.patch
# AI senate dismissal fix
# osdn #48018
# 0046-Fix-freeciv-web-build.patch
# Freeciv-web build fix
# RM #435
Expand Down Expand Up @@ -36,6 +33,9 @@
# 0061-savegame-Correct-loading-last-turn-change-time.patch
# Savegame loading fix
# RM #545
# 0073-savecompat-Fix-adding-ACTION_NONE-actions-for-units-.patch
# Savegame loading fix
# RM #577

# Not in the upstream Freeciv server
# ----------------------------------
Expand All @@ -59,7 +59,6 @@ declare -a GIT_PATCHLIST=(
)

declare -a PATCHLIST=(
"backports/0038-AI-Delay-war-declaration-until-really-revolted"
"backports/0046-Fix-freeciv-web-build"
"backports/0034-update_bulbs-Fix-research-researching_saved-research"
"backports/0050-Initialize-extra-before-calling-unit_assign_specific"
Expand All @@ -69,6 +68,7 @@ declare -a PATCHLIST=(
"backports/0060-Check-C23-nullptr-usability-as-a-sentinel"
"backports/0048-Handle-CoastStrict-units-correctly-on-city-removal"
"backports/0061-savegame-Correct-loading-last-turn-change-time"
"backports/0073-savecompat-Fix-adding-ACTION_NONE-actions-for-units-"
"RevertAmplio2ExtraUnits"
"meson_webperimental"
"metachange"
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
From 5da2436f71a1d1e17e5ba0b806f24434e29b32d3 Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <[email protected]>
Date: Thu, 9 May 2024 18:13:43 +0300
Subject: [PATCH 73/73] savecompat: Fix adding ACTION_NONE actions for units
with activities

See RM #577

Signed-off-by: Marko Lindqvist <[email protected]>
---
server/savegame/savecompat.c | 17 +++++++++++++++++
server/savegame/savegame3.c | 6 +++++-
2 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/server/savegame/savecompat.c b/server/savegame/savecompat.c
index 944bfdcb0d..322aae8644 100644
--- a/server/savegame/savecompat.c
+++ b/server/savegame/savecompat.c
@@ -2539,17 +2539,26 @@ static void compat_load_030300(struct loaddata *loading,
"player%d.u%d.activity", plrno, unro);

if (ei >= 0 && ei < loading->activities.size) {
+ bool found = FALSE;
+
activity = unit_activity_by_name(loading->activities.order[ei],
fc_strcasecmp);
+
act = activity_default_action(activity);

for (i = 0; i < loading->action.size; i++) {
if (act == loading->action.order[i]) {
secfile_insert_int(loading->file, i, "player%d.u%d.action",
plrno, unro);
+ found = TRUE;
break;
}
}
+
+ if (!found) {
+ secfile_insert_int(loading->file, ACTION_NONE, "player%d.u%d.action",
+ plrno, unro);
+ }
}
}
} player_slots_iterate_end;
@@ -3414,6 +3423,8 @@ static void compat_load_dev(struct loaddata *loading)
"player%d.u%d.activity", plrno, unro);

if (ei >= 0 && ei < loading->activities.size) {
+ bool found = FALSE;
+
activity = unit_activity_by_name(loading->activities.order[ei],
fc_strcasecmp);
act = activity_default_action(activity);
@@ -3422,9 +3433,15 @@ static void compat_load_dev(struct loaddata *loading)
if (act == loading->action.order[i]) {
secfile_insert_int(loading->file, i, "player%d.u%d.action",
plrno, unro);
+ found = TRUE;
break;
}
}
+
+ if (!found) {
+ secfile_insert_int(loading->file, ACTION_NONE, "player%d.u%d.action",
+ plrno, unro);
+ }
}
}
} player_slots_iterate_end;
diff --git a/server/savegame/savegame3.c b/server/savegame/savegame3.c
index 0a4726d538..137a990700 100644
--- a/server/savegame/savegame3.c
+++ b/server/savegame/savegame3.c
@@ -6197,7 +6197,11 @@ static bool sg_load_player_unit(struct loaddata *loading,
sg_warn_ret_val(secfile_lookup_int(loading->file, &ei,
"%s.action", unitstr), FALSE,
"%s", secfile_error());
- action = loading->action.order[ei];
+ if (ei == ACTION_NONE) {
+ action = ACTION_NONE;
+ } else {
+ action = loading->action.order[ei];
+ }

punit->birth_turn
= secfile_lookup_int_default(loading->file, game.info.turn,
--
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=2fe24b9457fa336fa62aeb990eebe3c3a58cb8e7
FCREV=b9a639bddc82e3134e551291b8b088ec97f65d6a

ORIGCAPSTR="+Freeciv.Devel-\${MAIN_VERSION}-2024.Apr.19"
ORIGCAPSTR="+Freeciv.Devel-\${MAIN_VERSION}-2024.Apr.19b"

# There's no need to bump this constantly as current freeciv-web
# makes no connections to outside world - all connections are
Expand Down
Loading