From 596e3fd2a0fcc2a4bbc365dae41f5989ed2912a1 Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Tue, 9 Jun 2026 03:04:24 +0300
Subject: [PATCH 36/36] Reorder packets sent when contact re-established

Send correct info about players to each other
before sending updated contact info to each player.
This makes sure that the client does not assume that
it already has contact provided info, when it actually
is only going to get it in the next packet.

Reported by Michael Ortmann

See RM #2043

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 server/plrhand.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/server/plrhand.c b/server/plrhand.c
index 021cad8a7c..759281b4f3 100644
--- a/server/plrhand.c
+++ b/server/plrhand.c
@@ -2354,10 +2354,15 @@ void make_contact(struct player *pplayer1, struct player *pplayer2,
       || team_has_embassy(pplayer2->team, pplayer1)) {
     return; /* Avoid sending too much info over the network */
   }
-  send_player_all_c(pplayer1, pplayer1->connections);
-  send_player_all_c(pplayer2, pplayer2->connections);
+  /* Send correct info about players to each other
+   * before sending updated contact info to each player.
+   * This makes sure that the client does not assume that
+   * it already has contact provided info, when it actually
+   * is only going to get it in the next packet. */
   send_player_info_c(pplayer1, pplayer2->connections);
   send_player_info_c(pplayer2, pplayer1->connections);
+  send_player_all_c(pplayer1, pplayer1->connections);
+  send_player_all_c(pplayer2, pplayer2->connections);
 }
 
 /**********************************************************************//**
-- 
2.53.0

