Skip to content

Commit

Permalink
Server: Backport 0034-update_bulbs-Fix-research-researching_saved-res…
Browse files Browse the repository at this point in the history
…earch.patch

Signed-off-by: Marko Lindqvist <[email protected]>
  • Loading branch information
cazfi committed Apr 15, 2024
1 parent aaadb8c commit cb10b2d
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
4 changes: 4 additions & 0 deletions freeciv/apply_patches.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
# 0053-AI-Fix-bad-city-spot-value-calculation-with-unknown-.patch
# AI city spot evaluation fix
# RM #408
# 0034-update_bulbs-Fix-research-researching_saved-research.patch
# Fix to research assert failure
# RM #449

# Not in the upstream Freeciv server
# ----------------------------------
Expand Down Expand Up @@ -45,6 +48,7 @@ declare -a PATCHLIST=(
"backports/0051-Adjust-nationality-of-remaining-units-after-player-r"
"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"
"RevertAmplio2ExtraUnits"
"meson_webperimental"
"metachange"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
From d6481dd6a44d7782eacc9df34bc3e935f6528827 Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <[email protected]>
Date: Sun, 14 Apr 2024 01:05:11 +0300
Subject: [PATCH 34/35] update_bulbs(): Fix "research->researching_saved !=
research->researching" assert

See RM #449

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

diff --git a/server/techtools.c b/server/techtools.c
index 2144eeeef9..261c18005e 100644
--- a/server/techtools.c
+++ b/server/techtools.c
@@ -662,10 +662,10 @@ void update_bulbs(struct player *pplayer, int bulbs, bool check_tech,
}
fc_assert_ret(research);

- /* count our research contribution this turn */
+ /* Count our research contribution this turn */
pplayer->server.bulbs_last_turn += bulbs;
research->bulbs_researched += bulbs;
- if (A_UNKNOWN != research->researching_saved) {
+ if (research->researching_saved != A_UNKNOWN && research->researching_saved != A_UNSET) {
fc_assert(research->researching_saved != research->researching);
research->bulbs_researching_saved += bulbs;
}
--
2.43.0

0 comments on commit cb10b2d

Please sign in to comment.