<URL: http://bugs.freeciv.org/Ticket/Display.html?id=39503 >

Patch for S2_0

Index: server/stdinhand.c
===================================================================
--- server/stdinhand.c	(révision 14852)
+++ server/stdinhand.c	(copie de travail)
@@ -3719,6 +3719,7 @@
   enum m_pre_result match_result;
   struct connection *ptarget;
   struct player *pplayer;
+  bool was_connected;
 
   ptarget = find_conn_by_user_prefix(name, &match_result);
 
@@ -3730,6 +3731,7 @@
   }
 
   pplayer = ptarget->player;
+  was_connected = pplayer ? pplayer->is_connected : FALSE;
 
   cmd_reply(CMD_CUT, caller, C_DISCONNECTED,
 	    _("Cutting connection %s."), ptarget->username);
@@ -3737,7 +3739,7 @@
   close_connection(ptarget);
 
   /* if we cut the connection, unassign the login name */
-  if (pplayer) {
+  if (pplayer && was_connected && !pplayer->is_connected) {
     sz_strlcpy(pplayer->username, ANON_USER_NAME);
   }
   return TRUE;
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to