Author: pepeto
Date: Fri Oct 24 18:38:13 2014
New Revision: 26852

URL: http://svn.gna.org/viewcvs/freeciv?rev=26852&view=rev
Log:
Link transporter units with their cargo for foreigner players. It was broken
when the transporter info was received after the cargo info.

Originally reported by Marko Lindqvist <cazfi> in bug #20726

See gna bug #22851

Modified:
    branches/S2_5/client/packhand.c

Modified: branches/S2_5/client/packhand.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/client/packhand.c?rev=26852&r1=26851&r2=26852&view=diff
==============================================================================
--- branches/S2_5/client/packhand.c     (original)
+++ branches/S2_5/client/packhand.c     Fri Oct 24 18:38:13 2014
@@ -1612,6 +1612,18 @@
 
     repaint_unit = !unit_transported(punit);
     agents_unit_new(punit);
+
+    /* Check if we should link cargo units. */
+    if (client_has_player()
+        && unit_owner(punit) != client_player()
+        && punit->client.occupied) {
+      unit_list_iterate(unit_tile(punit)->units, aunit) {
+        if (aunit->client.transported_by == punit->id) {
+          fc_assert(aunit->transporter == NULL);
+          unit_transport_load(aunit, punit, TRUE);
+        }
+      } unit_list_iterate_end;
+    }
 
     if ((pcity = tile_city(unit_tile(punit)))) {
       /* The unit is in a city - obviously it's occupied. */


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to