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 #801

Merged
merged 2 commits into from
Jan 7, 2024
Merged

Srvup #801

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
4 changes: 4 additions & 0 deletions freeciv/apply_patches.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
# 0017-Fix-city-removal-server-crashes.patch
# Crash fix
# RM #81
# 0004-Fix-bombard-rate-always-being-1.patch
# Bombard action fix
# RM #93

# Not in the upstream Freeciv server
# ----------------------------------
Expand Down Expand Up @@ -48,6 +51,7 @@ declare -a PATCHLIST=(
"backports/0031-Meson-Enable-implicit-fallthrough-compiler-warnings"
"backports/0014-Improve-savemain.c-coding-style"
"backports/0017-Fix-city-removal-server-crashes"
"backports/0004-Fix-bombard-rate-always-being-1"
"meson_webperimental"
"metachange"
"text_fixes"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
From 8998a1c138c94f5d73bf9b6ee2e8b2a3f518ee3f Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <[email protected]>
Date: Fri, 29 Dec 2023 17:26:30 +0200
Subject: [PATCH 04/22] Fix bombard rate always being 1

Ruleset defined value had no effect, as unit_bombard_rate()
erroneously sanitised scaling result with MIN(), and not MAX()

See RM #93

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

diff --git a/common/combat.c b/common/combat.c
index a6552696a8..9af193d7c4 100644
--- a/common/combat.c
+++ b/common/combat.c
@@ -1025,7 +1025,7 @@ int unit_bombard_rate(struct unit *punit)
if (game.info.damage_reduces_bombard_rate && base_bombard_rate > 0) {
int rate = (base_bombard_rate * punit->hp) / utype->hp;

- return MIN(rate, 1);
+ return MAX(rate, 1);
}

return base_bombard_rate;
--
2.43.0

2 changes: 1 addition & 1 deletion freeciv/version.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# The Git SHA hash for the commit to checkout from
# https://github.com/freeciv/freeciv

FCREV=4e9292e4a52c257d0b02f667614609cb31a686ab
FCREV=5775c24ef12f60e5658c54594a71c11456700638

ORIGCAPSTR="+Freeciv.Devel-\${MAIN_VERSION}-2023.Dec.04"

Expand Down