[Freeciv-Dev] (PR#5642) Re: Re: (PR#5840) Server crash while taking a ca
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Per I. Mathisen wrote:
> On Thu, 4 Sep 2003, Jason Short wrote:
>
>>>Player 'Jaume I' now has AI skill level 'easy'.
>>>0: LiuBei's Transport (id 1311) left a unit stranded in the ocean
>>>without a transport at position (23, 19). Capacity on old tile is -2
>>>and 46 on new tile, which is at position (22, 23). ransport_units is false
>>>civserver: shared.c:662: die: Assertion `0' failed.
>>
>>Since it's an anonymous bug report, I'm guessing we're not going to get
>>a savegame.
>>
>>Greg, Per - do you guys know why this might happen?Maybe as a result
>>of civil war, the transporter and transportee are no longer from the
>>same nation?
>
>
> The error is the assert I added in move_unit(). It should go away.
Patch attached.
Personally, I'd rather see the check stay and have the caller be
"fixed". But this is very zealous and not really necessary.
jason
Index: server/unittools.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/unittools.c,v
retrieving revision 1.246
diff -u -r1.246 unittools.c
--- server/unittools.c 2003/09/01 19:09:49 1.246
+++ server/unittools.c 2003/09/04 22:59:49
@@ -2902,16 +2902,10 @@
conn_list_do_unbuffer(&pplayer->connections);
- if (is_ocean(map_get_terrain(src_x, src_y))
- && ground_unit_transporter_capacity(src_x, src_y, pplayer) < 0) {
- die("%s's %s (id %d) left a unit stranded in the ocean without a "
- "transport at position (%d, %d). Capacity on old tile is %d "
- " and %d on new tile, which is at position (%d, %d). ransport_units "
- "is %s", pplayer->name, unit_name(punit->type), punit->id, src_x,
src_y,
- ground_unit_transporter_capacity(src_x, src_y, pplayer),
- ground_unit_transporter_capacity(dest_x, dest_y, pplayer),
- dest_x, dest_y, transport_units ? "true" : "false");
- }
+ /* Note, an individual call to move_unit may leave things in an unstable
+ * state (e.g., negative transporter capacity) if more than one unit is
+ * being moved at a time (e.g., bounce unit) and they are not done in the
+ * right order. This is probably not a bug. */
if (map_has_special(dest_x, dest_y, S_HUT)) {
return unit_enter_hut(punit);
|
|