freeciv-2.6: Backport fix to unit bribing server crash
Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
From d3e0ef6afe7c3f99d6a2af400d0c7c776695ac84 Mon Sep 17 00:00:00 2001
|
||||
From: Marko Lindqvist <cazfi74@gmail.com>
|
||||
Date: Thu, 2 Nov 2023 22:56:11 +0200
|
||||
Subject: [PATCH 2/2] Fix server crash when bribing
|
||||
|
||||
Reported by omero
|
||||
|
||||
See osdn #48931
|
||||
|
||||
Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
|
||||
---
|
||||
server/diplomats.c | 12 ++++++------
|
||||
1 file changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/server/diplomats.c b/server/diplomats.c
|
||||
index 9787a82d0e..83547aa68f 100644
|
||||
--- a/server/diplomats.c
|
||||
+++ b/server/diplomats.c
|
||||
@@ -221,6 +221,12 @@ void diplomat_investigate(struct player *pplayer, struct unit *pdiplomat,
|
||||
action_consequence_success(ACTION_SPY_INVESTIGATE_CITY, pplayer, cplayer,
|
||||
city_tile(pcity), city_link(pcity));
|
||||
|
||||
+ conn_list_iterate(pplayer->connections, pconn) {
|
||||
+ if (has_capability("obsinv", pconn->capability)) {
|
||||
+ dsend_packet_investigate_finished(pconn, pdiplomat->id, pcity->id);
|
||||
+ }
|
||||
+ } conn_list_iterate_end;
|
||||
+
|
||||
/* Spies always survive. Diplomats never do. */
|
||||
if (!unit_has_type_flag(pdiplomat, UTYF_SPY)) {
|
||||
wipe_unit(pdiplomat, ULR_USED, NULL);
|
||||
@@ -1483,12 +1489,6 @@ static bool diplomat_infiltrate_tile(struct player *pplayer,
|
||||
}
|
||||
} unit_list_iterate_end;
|
||||
|
||||
- conn_list_iterate(pplayer->connections, pconn) {
|
||||
- if (has_capability("obsinv", pconn->capability)) {
|
||||
- dsend_packet_investigate_finished(pconn, pdiplomat->id, pcity->id);
|
||||
- }
|
||||
- } conn_list_iterate_end;
|
||||
-
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
--
|
||||
2.42.0
|
||||
|
||||
@@ -3,6 +3,7 @@ require freeciv-qt5.inc
|
||||
|
||||
SRC_URI += "\
|
||||
${SOURCEFORGE_MIRROR}/freeciv/freeciv-${PV}.tar.bz2 \
|
||||
file://0002-Fix-server-crash-when-bribing.patch \
|
||||
file://allow-root.patch \
|
||||
file://dummy-qtver-S2_6.patch \
|
||||
"
|
||||
|
||||
Reference in New Issue
Block a user