Skip to content

Commit

Permalink
Server: Backport 0048-Make-action-selection-dialog-to-appear-on-airli…
Browse files Browse the repository at this point in the history
…ft.patch

Signed-off-by: Marko Lindqvist <[email protected]>
  • Loading branch information
cazfi committed Nov 2, 2024
1 parent d2f7023 commit 3c1dbc4
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 2 deletions.
8 changes: 6 additions & 2 deletions freeciv/apply_patches.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

# Freeciv server version upgrade notes (backports)
# ------------------------------------------------
# osdn #????? or RM #??? is a ticket in freeciv.org tracker:
# osdn #????? or RM #???? is a ticket in freeciv.org tracker:
# https://osdn.net/projects/freeciv/ticket/?????
# https://redmine.freeciv.org/issues/???
# https://redmine.freeciv.org/issues/????
#
# 0068-AI-Remove-shared-vision-from-pending-war-target-once.patch
# AI assert fix
Expand All @@ -18,6 +18,9 @@
# 0046-Fix-combat-veterancy-chance.patch
# Fix veterancy gaining
# RM #983
# 0048-Make-action-selection-dialog-to-appear-on-airlift.patch
# Action list popup fix
# RM #1028

# Not in the upstream Freeciv server
# ----------------------------------
Expand All @@ -42,6 +45,7 @@ declare -a PATCHLIST=(
"backports/0038-map_init_topology-Operate-on-any-map"
"backports/0030-Tex-Initialize-map-topology"
"backports/0046-Fix-combat-veterancy-chance"
"backports/0048-Make-action-selection-dialog-to-appear-on-airlift"
"RevertAmplio2ExtraUnits"
"meson_webperimental"
"metachange"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
From ebfe8b397bea164ea772432304d819f1285afe35 Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <[email protected]>
Date: Tue, 29 Oct 2024 04:57:49 +0200
Subject: [PATCH 48/52] Make action selection dialog to appear on airlift

Reported by Helge

See RM #1028

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

diff --git a/server/unittools.c b/server/unittools.c
index a7977f05e1..768e11353a 100644
--- a/server/unittools.c
+++ b/server/unittools.c
@@ -4142,15 +4142,6 @@ bool unit_move(struct unit *punit, struct tile *pdesttile, int move_cost,
punit->action_decision_tile = NULL;
punit->action_decision_want = ACT_DEC_NOTHING;

- if (!adj && action_tgt_city(punit, pdesttile, FALSE)) {
- /* The unit can perform an action to the city at the destination tile.
- * A long distance move (like an airlift) doesn't ask what action to
- * perform before moving. Ask now. */
-
- punit->action_decision_want = ACT_DEC_PASSIVE;
- punit->action_decision_tile = pdesttile;
- }
-
/* Claim ownership of fortress? */
if (conquer_extras_allowed
&& tile_has_claimable_base(pdesttile, unit_type_get(punit))) {
@@ -4187,6 +4178,15 @@ bool unit_move(struct unit *punit, struct tile *pdesttile, int move_cost,
}
}

+ if (!adj && action_tgt_city(punit, pdesttile, FALSE)) {
+ /* The unit can perform an action to the city at the destination tile.
+ * A long distance move (like an airlift) doesn't ask what action to
+ * perform before moving. Ask now. */
+
+ punit->action_decision_want = ACT_DEC_PASSIVE;
+ punit->action_decision_tile = pdesttile;
+ }
+
/* Notifications of the move to the clients. */
if (adj) {
/* Special case: 'punit' is moving to adjacent position. Then we show
--
2.45.2

0 comments on commit 3c1dbc4

Please sign in to comment.