Skip to content

Commit

Permalink
Merge pull request #834 from cazfi/srvup
Browse files Browse the repository at this point in the history
  • Loading branch information
cazfi authored Apr 22, 2024
2 parents 87dc93d + 0877051 commit 6fe9c44
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 2 deletions.
8 changes: 8 additions & 0 deletions freeciv/apply_patches.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
# 0034-update_bulbs-Fix-research-researching_saved-research.patch
# Fix to research assert failure
# RM #449
# 0050-Initialize-extra-before-calling-unit_assign_specific.patch
# Pillage crash fix
# RM #460
# 0050-savegame-Fix-loading-invalid-resources-on-FoW-map.patch
# Savegame resources loading fix
# RM #463

# Not in the upstream Freeciv server
# ----------------------------------
Expand Down Expand Up @@ -49,6 +55,8 @@ declare -a PATCHLIST=(
"backports/0038-AI-Delay-war-declaration-until-really-revolted"
"backports/0053-AI-Fix-bad-city-spot-value-calculation-with-unknown-"
"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"
"RevertAmplio2ExtraUnits"
"meson_webperimental"
"metachange"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
From 395d7098cff931e9e6ef07c9d0eace5aa47bf864 Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <[email protected]>
Date: Wed, 17 Apr 2024 00:35:05 +0300
Subject: [PATCH 50/50] Initialize extra before calling
unit_assign_specific_activity_target()

If the extra going in is not NULL, it's assumed to be ok to begin with,
and no real extra gets assigned.

See RM #460

Signed-off-by: Marko Lindqvist <[email protected]>
---
server/actiontools.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/server/actiontools.c b/server/actiontools.c
index 590a46a215..2f6da9ade6 100644
--- a/server/actiontools.c
+++ b/server/actiontools.c
@@ -906,7 +906,7 @@ int action_sub_target_id_for_action(const struct action *paction,
case ASTK_EXTRA_NOT_THERE:
if (action_has_result(paction, ACTRES_PILLAGE)) {
/* Special treatment for "Pillage" */
- struct extra_type *pextra;
+ struct extra_type *pextra = NULL;
enum unit_activity activity = action_get_activity(paction);

unit_assign_specific_activity_target(actor_unit, &activity, &pextra);
--
2.43.0

Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
From 8d719e330a4c48024f50026f3053d15c828b2dd3 Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <[email protected]>
Date: Wed, 17 Apr 2024 20:51:26 +0300
Subject: [PATCH 50/50] savegame: Fix loading invalid resources on FoW map

See RM #463

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

diff --git a/server/savegame/savegame3.c b/server/savegame/savegame3.c
index de2fa885a3..875839dec0 100644
--- a/server/savegame/savegame3.c
+++ b/server/savegame/savegame3.c
@@ -7160,9 +7160,11 @@ static void sg_load_player_vision(struct loaddata *loading,
struct player_tile *plrtile = map_get_player_tile(ptile, plr);

extra_type_by_cause_iterate(EC_RESOURCE, pres) {
- if (BV_ISSET(plrtile->extras, extra_number(pres))
- && terrain_has_resource(plrtile->terrain, pres)) {
+ if (BV_ISSET(plrtile->extras, extra_number(pres))) {
plrtile->resource = pres;
+ if (!terrain_has_resource(plrtile->terrain, pres)) {
+ BV_CLR(plrtile->extras, extra_number(pres));
+ }
}
} extra_type_by_cause_iterate_end;
} whole_map_iterate_end;
--
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=9dc97fc1a5b233c972daf4e0f7dcfa80d49d79ea
FCREV=11a78effe8793539ccbd46c4a0dc4180eea5053b

ORIGCAPSTR="+Freeciv.Devel-\${MAIN_VERSION}-2024.Mar.30"
ORIGCAPSTR="+Freeciv.Devel-\${MAIN_VERSION}-2024.Apr.02"

# 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 6fe9c44

Please sign in to comment.