Skip to content

Commit

Permalink
Merge pull request #866 from cazfi/srvup
Browse files Browse the repository at this point in the history
  • Loading branch information
cazfi authored Oct 22, 2024
2 parents 306fa69 + 1fdf5ea commit 2cca5d3
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 79 deletions.
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/???
#
# 0048-Handle-CoastStrict-units-correctly-on-city-removal.patch
# Fix to unit placement after city destruction
# RM #525
# 0061-savegame-Correct-loading-last-turn-change-time.patch
# Savegame loading fix
# RM #545
Expand Down Expand Up @@ -39,6 +36,9 @@
# 0030-Tex-Initialize-map-topology.patch
# Tex AI map topology fix
# RM #663
# 0046-Fix-combat-veterancy-chance.patch
# Fix veterancy gaining
# RM #983

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

declare -a PATCHLIST=(
"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-"
"backports/0089-Meson-Make-fc_client_common-to-depend-on-verhdr"
Expand All @@ -73,6 +72,7 @@ declare -a PATCHLIST=(
"backports/0068-AI-Remove-shared-vision-from-pending-war-target-once"
"backports/0038-map_init_topology-Operate-on-any-map"
"backports/0030-Tex-Initialize-map-topology"
"backports/0046-Fix-combat-veterancy-chance"
"RevertAmplio2ExtraUnits"
"meson_webperimental"
"metachange"
Expand Down
35 changes: 35 additions & 0 deletions freeciv/patches/backports/0046-Fix-combat-veterancy-chance.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
From b739562d61054e143e901c16b2e61037f1c44c59 Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <[email protected]>
Date: Sat, 19 Oct 2024 02:33:02 +0300
Subject: [PATCH 46/46] Fix combat veterancy chance

It was always zero (integer math for 0.00 - 0.99) when
it was supposed to be scaled to how challenging the combat was.

Reported by Moke

See RM #983

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

diff --git a/server/unittools.c b/server/unittools.c
index 6ba61bceda..eab53957fe 100644
--- a/server/unittools.c
+++ b/server/unittools.c
@@ -321,8 +321,8 @@ bool unit_versus_unit(struct unit *attacker, struct unit *defender,
/* In a combat between equal strength units the values are 50% / 50%.
* -> scaling that to 100% by doubling, to match scale of chances
* in existing rulesets, and in !combat_odds_scaled_veterancy case. */
- *att_vet = def_strength * 2 / (att_strength + def_strength);
- *def_vet = att_strength * 2 / (att_strength + def_strength);
+ *att_vet = 100 * def_strength * 2 / (att_strength + def_strength);
+ *def_vet = 100 * att_strength * 2 / (att_strength + def_strength);

if (attackpower == 0) {
*att_hp = 0;
--
2.45.2

This file was deleted.

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=342fd98f209c0a4490b368ffc5156b9ef093af34
FCREV=e30c986c070fb8ac2c415e15300f44aa1a5ce20f

ORIGCAPSTR="+Freeciv.Devel-\${MAIN_VERSION}-2024.May.11"
ORIGCAPSTR="+Freeciv.Devel-\${MAIN_VERSION}-2024.May.13"

# 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 2cca5d3

Please sign in to comment.