From 40be7ee3aa482cd6fc2ad90879f01e78df067f74 Mon Sep 17 00:00:00 2001 From: cazfi Date: Wed, 10 Aug 2016 09:10:02 +0000 Subject: [PATCH] Remove drowning units from the clients even if they didn't see those units when they still had not jumped out of the sinking transport. Reported by Christian Knoke See bug #24921 git-svn-id: svn://svn.gna.org/svn/freeciv/branches/S2_6@33537 a0f10bec-cc02-0410-94fc-a9cfff90b4cd --- server/unittools.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/server/unittools.c b/server/unittools.c index d1fb174077..300c92d85b 100644 --- a/server/unittools.c +++ b/server/unittools.c @@ -1707,7 +1707,15 @@ static void unit_lost_with_transport(const struct player *pplayer, _("%s lost when %s was lost."), unit_tile_link(pcargo), utype_name_translation(ptransport)); - wipe_unit_full(pcargo, TRUE, ULR_TRANSPORT_LOST, killer); + /* Unit is not transported any more at this point, but it has jumped + * off the transport and drowns outside. So it must be removed from + * all clients. + * However, we don't know if given client has received ANY updates + * about the swimming unit, and we can't remove it if it's not there + * in the first place -> we send it once here just to be sure it's + * there. */ + send_unit_info(NULL, pcargo); + wipe_unit_full(pcargo, FALSE, ULR_TRANSPORT_LOST, killer); } /**************************************************************************** @@ -1754,7 +1762,11 @@ static void wipe_unit_full(struct unit *punit, bool transported, } /* Could use unit_transport_unload_send here, but that would - * call send_unit_info for the transporter unnecessarily. */ + * call send_unit_info for the transporter unnecessarily. + * Note that this means that unit might to get seen briefly + * by clients other than owner's, for example as a result of + * update of homecity common to this cargo and some other + * destroyed unit. */ unit_transport_unload(pcargo); if (pcargo->activity == ACTIVITY_SENTRY) { /* Activate sentried units - like planes on a disbanded carrier. -- 2.11.4.GIT