Skip to content

Commit

Permalink
Server: Backport 0026-savecompat-Add-wlcb-for-all-cities.patch
Browse files Browse the repository at this point in the history
Signed-off-by: Marko Lindqvist <[email protected]>
  • Loading branch information
cazfi committed Jan 10, 2024
1 parent a3cbd7b commit 7b844bf
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 2 deletions.
8 changes: 6 additions & 2 deletions freeciv/apply_patches.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

# Freeciv server version upgrade notes (backports)
# ------------------------------------------------
# osdn #????? or RM #?? is a ticket in freeciv.org tracker:
# osdn #????? or RM #??? is a ticket in freeciv.org tracker:
# https://osdn.net/projects/freeciv/ticket/?????
# https://redmine.freeciv.org/issues/??
# https://redmine.freeciv.org/issues/???
#
# 0031-Meson-Enable-implicit-fallthrough-compiler-warnings.patch
# Stricter compiler warnings
Expand All @@ -18,6 +18,9 @@
# 0004-Fix-bombard-rate-always-being-1.patch
# Bombard action fix
# RM #93
# 0026-savecompat-Add-wlcb-for-all-cities.patch
# Savegame loading fix
# RM #143

# Not in the upstream Freeciv server
# ----------------------------------
Expand All @@ -44,6 +47,7 @@ declare -a PATCHLIST=(
"backports/0014-Improve-savemain.c-coding-style"
"backports/0017-Fix-city-removal-server-crashes"
"backports/0004-Fix-bombard-rate-always-being-1"
"backports/0026-savecompat-Add-wlcb-for-all-cities"
"meson_webperimental"
"metachange"
"text_fixes"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
From 8630ed0993437f5cd3b15aa7f3363c4421d8519a Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <[email protected]>
Date: Mon, 8 Jan 2024 06:53:37 +0200
Subject: [PATCH 26/26] savecompat: Add wlcb for all cities

It's a mandatory field, so failure to add it for non-conquered
cities lead to savegame loading failure.

See RM #143

Signed-off-by: Marko Lindqvist <[email protected]>
---
server/savegame/savecompat.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/server/savegame/savecompat.c b/server/savegame/savecompat.c
index 26b1d1e7cb..93bbab9f8e 100644
--- a/server/savegame/savecompat.c
+++ b/server/savegame/savecompat.c
@@ -2375,14 +2375,15 @@ static void compat_load_030200(struct loaddata *loading,
secfile_insert_int(loading->file, CACQ_CONQUEST,
"player%d.c%d.acquire_t",
plrno, cnro);
- secfile_insert_int(loading->file, WLCB_SMART,
- "player%d.c%d.wlcb",
- plrno, cnro);
} else {
secfile_insert_int(loading->file, CACQ_FOUNDED,
"player%d.c%d.acquire_t",
plrno, cnro);
}
+
+ secfile_insert_int(loading->file, WLCB_SMART,
+ "player%d.c%d.wlcb",
+ plrno, cnro);
}
}

--
2.43.0

0 comments on commit 7b844bf

Please sign in to comment.