diff --git a/recipes-games/freeciv/freeciv/0002-Fix-server-crash-when-bribing.patch b/recipes-games/freeciv/freeciv/0002-Fix-server-crash-when-bribing.patch new file mode 100644 index 0000000..a57b736 --- /dev/null +++ b/recipes-games/freeciv/freeciv/0002-Fix-server-crash-when-bribing.patch @@ -0,0 +1,47 @@ +From d3e0ef6afe7c3f99d6a2af400d0c7c776695ac84 Mon Sep 17 00:00:00 2001 +From: Marko Lindqvist +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 +--- + 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 + diff --git a/recipes-games/freeciv/freeciv_2.6.10.bb b/recipes-games/freeciv/freeciv_2.6.10.bb index ecd4e7d..5c8555b 100644 --- a/recipes-games/freeciv/freeciv_2.6.10.bb +++ b/recipes-games/freeciv/freeciv_2.6.10.bb @@ -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 \ "