[Freeciv-Dev] (PR#12980) Fix idx warning in client when transfering unit
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: |
[Freeciv-Dev] (PR#12980) Fix idx warning in client when transfering units |
From: |
"Per I. Mathisen" <per@xxxxxxxxxxx> |
Date: |
Wed, 4 May 2005 09:54:38 -0700 |
Reply-to: |
bugs@xxxxxxxxxxx |
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=12980 >
When units are transfered between players, the client will complain loudly
about hash collisions. This patches fixes these warnings.
- Per
Index: client/packhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/packhand.c,v
retrieving revision 1.501
diff -u -r1.501 packhand.c
--- client/packhand.c 2 May 2005 15:42:52 -0000 1.501
+++ client/packhand.c 4 May 2005 16:53:34 -0000
@@ -954,7 +954,12 @@
bool ret = FALSE;
punit = player_find_unit_by_id(get_player(packet_unit->owner),
- packet_unit->id);
+ packet_unit->id);
+ if (!punit && find_unit_by_id(packet_unit->id)) {
+ /* This means unit has changed owner. We deal with this here
+ * by simply deleting the old one and creating a new one. */
+ handle_unit_remove(packet_unit->id);
+ }
if (punit) {
const int old_transported_by = punit->transported_by;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Freeciv-Dev] (PR#12980) Fix idx warning in client when transfering units,
Per I. Mathisen <=
|
|