Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2004:
[Freeciv-Dev] Re: (PR#9716) fill_ranges_improv_lists assert
Home

[Freeciv-Dev] Re: (PR#9716) fill_ranges_improv_lists assert

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: chrisk@xxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#9716) fill_ranges_improv_lists assert
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 18 Aug 2004 09:53:18 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=9716 >

#5  0x4071bb3f in *__GI___assert_fail (assertion=0x0, file=0x0, line=0,
     function=0x81664b6 "fill_ranges_improv_lists") at assert.c:83
#6  0x080f1fbe in fill_ranges_improv_lists (equiv_list=0xbffff4c0,
     pcity=0x83bca70, pplayer=0x8199cc0) at improvement.c:289
#7  0x080f23f5 in mark_improvement (pcity=0x83bca70, id=B_CITY,
     status=1 '\001') at improvement.c:464
#8  0x080ea7da in city_add_improvement (pcity=0x83bca70, impr=B_CITY)
     at city.c:2594
#9  0x0808537f in update_improvement_from_packet (pcity=0x83bca70,
     impr=B_CITY, have_impr=true, impr_changed=0xbffff561) at packhand.c:308
#10 0x08086263 in handle_city_short_info (packet=0x83ff118) at 
packhand.c:703
#11 0x0808ca94 in client_handle_packet (type=PACKET_CITY_SHORT_INFO,
     packet=0x83ff118) at packhand_gen.c:119
#12 0x0806f208 in handle_packet_input (packet=0x83ff118, type=22)
     at civclient.c:274
#13 0x08072ee0 in input_from_server (fd=4) at clinet.c:328
#14 0x080bb476 in get_net_input (data=0x0, fid=4, condition=GDK_INPUT_READ)
     at gui_main.c:1456
#15 0x4031919b in gdk_get_show_events () from /usr/lib/libgdk-x11-2.0.so.0

With this patch you can see that the values sent are actually correct. 
With an additional log call added it becomes clear that the problem is 
that the tile info isn't being sent - or rather, that the city info (for 
the city on the tile) is being sent before the tile info itself.

jason




Index: client/packhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/packhand.c,v
retrieving revision 1.395
diff -u -r1.395 packhand.c
--- client/packhand.c   14 Aug 2004 21:46:27 -0000      1.395
+++ client/packhand.c   18 Aug 2004 16:50:42 -0000
@@ -2016,6 +2016,8 @@
     map.num_continents = 0;
   }
 
+  assert(is_ocean(packet->type) || packet->continent > 0);
+  assert(!is_ocean(packet->type) || packet->continent < 0);
   ptile->continent = packet->continent;
 
   if (ptile->continent > map.num_continents) {
Index: server/maphand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/maphand.c,v
retrieving revision 1.138
diff -u -r1.138 maphand.c
--- server/maphand.c    13 Aug 2004 15:59:13 -0000      1.138
+++ server/maphand.c    18 Aug 2004 16:50:44 -0000
@@ -354,6 +354,8 @@
       if (pplayer) {
        update_tile_knowledge(pplayer,x,y);
       }
+      assert(is_ocean(info.type) || info.continent > 0);
+      assert(!is_ocean(info.type) || info.continent < 0);
       send_packet_tile_info(pconn, &info);
     } else if (pplayer && map_is_known(x, y, pplayer)
               && map_get_seen(x, y, pplayer) == 0) {
@@ -363,6 +365,8 @@
       info.type = plrtile->terrain;
       info.special = plrtile->special;
       info.continent = ptile->continent;
+      assert(is_ocean(info.type) || info.continent > 0);
+      assert(!is_ocean(info.type) || info.continent < 0);
       send_packet_tile_info(pconn, &info);
     }
   }
@@ -422,6 +426,8 @@
     info.special = ptile->special;
     info.continent = ptile->continent;
   }
+  assert(is_ocean(info.type) || info.continent > 0);
+  assert(!is_ocean(info.type) || info.continent < 0);
   lsend_packet_tile_info(dest, &info);
 }
 

[Prev in Thread] Current Thread [Next in Thread]