Skip to content

Commit

Permalink
Merge pull request #877 from cazfi/srvup
Browse files Browse the repository at this point in the history
  • Loading branch information
cazfi authored Nov 29, 2024
2 parents dd4409f + cf77708 commit 30ad0fc
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 5 deletions.
4 changes: 4 additions & 0 deletions freeciv/apply_patches.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
# 0048-Make-action-selection-dialog-to-appear-on-airlift.patch
# Action list popup fix
# RM #1028
# 0045-unit_server_side_agent_set-Send-unit-info-only-if-ss.patch
# Focus unit fix
# RM #1104

# Not in the upstream Freeciv server
# ----------------------------------
Expand All @@ -34,6 +37,7 @@ declare -a GIT_PATCHLIST=(
declare -a PATCHLIST=(
"backports/0046-Fix-combat-veterancy-chance"
"backports/0048-Make-action-selection-dialog-to-appear-on-airlift"
"backports/0045-unit_server_side_agent_set-Send-unit-info-only-if-ss"
"RevertAmplio2ExtraUnits"
"meson_webperimental"
"metachange"
Expand Down
7 changes: 3 additions & 4 deletions freeciv/patches/RevertAmplio2ExtraUnits.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/data/amplio2/extra_units.spec b/data/amplio2/extra_units.spec
index 97457e7063..8890179983 100644
index 92c2baa7ca..4c9d1523d8 100644
--- a/data/amplio2/extra_units.spec
+++ b/data/amplio2/extra_units.spec
@@ -26,105 +26,27 @@ dy = 48
@@ -26,105 +26,25 @@ dy = 48
pixel_border = 1

tiles = { "row", "column", "tag"
Expand Down Expand Up @@ -111,8 +111,7 @@ index 97457e7063..8890179983 100644
- 10, 10, "u.elephant_Idle"
- 10, 11, "u.polar_bear_Idle"
- 10, 12, "u.squid_Idle"
+
10, 13, "u.storm_Idle"
-
- 10, 14, "u.mammoth_Idle"
+
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
From 384543aee1c82ad874ded6da78e632d514ad58f9 Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <[email protected]>
Date: Mon, 11 Nov 2024 05:09:02 +0200
Subject: [PATCH 45/78] unit_server_side_agent_set(): Send unit info only if
ssa_agent really changed

Saves some CPU cycles. More importantly for now mitigates
a problem that when a unit with an activity is selected on
the client side, it won't stay on focus if server sends
this unit info packet before the activity has been cleared
to be ACTIVITY_IDLE.

Focus problems reported by bard and Helge

See RM #1104

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

diff --git a/server/unithand.c b/server/unithand.c
index a449223d83..87e51052d7 100644
--- a/server/unithand.c
+++ b/server/unithand.c
@@ -6585,9 +6585,10 @@ bool unit_server_side_agent_set(struct player *pplayer,
break;
}

- punit->ssa_controller = agent;
-
- send_unit_info(NULL, punit);
+ if (punit->ssa_controller != agent) {
+ punit->ssa_controller = agent;
+ send_unit_info(NULL, punit);
+ }

return TRUE;
}
--
2.45.2

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=ccddb209ef986da35b737e797b856bd9e144e3b8
FCREV=dc977345b1519d409318e3aaa4d7711765f689b7

ORIGCAPSTR="+Freeciv.Devel-\${MAIN_VERSION}-2024.June.08"

Expand Down

0 comments on commit 30ad0fc

Please sign in to comment.