Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2004:
[Freeciv-Dev] Re: (PR#7463) server crash on disbanding a city
Home

[Freeciv-Dev] Re: (PR#7463) server crash on disbanding a city

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: bh@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#7463) server crash on disbanding a city
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 22 Feb 2004 09:00:52 -0800
Reply-to: rt@xxxxxxxxxxx

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

Raimar Falke wrote:
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=7463 >
> 
> On Sat, Feb 21, 2004 at 11:59:59PM -0800, Jason Short wrote:
> 
>><URL: http://rt.freeciv.org/Ticket/Display.html?id=7463 >
>>
>>>[bhudson - Sun Feb 22 03:38:44 2004]:
>>>
>>>go to the city Callandar.
>>>check the box in settings -> Disband.
>>>make an engineer be the thing being built, buy it.
>>>end turn.
>>>crash.
>>>
>>>This happens even if you delay doing these actions a turn or two.
>>>
>>>The message:
>>> civserver: unittools.c:1600: server_remove_unit: Assertion
>>>`pcargo->transported_by != punit->id' failed.
>>
>>No doubt this is my fault.
> 
> What exactly? And why?

Nobody else has been working on the transported_by field.

>>After a quick look the logic is unclear to me.  I don't know why
>>this is happening.
> 
>>I'm pretty sure that compiling with --disable-debug will fix it.
> 
> That is not a solution.

Just a workaround to let the game be playable, of course.

Here's the proper fix.  Quite a thinko.

jason

Index: server/citytools.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/citytools.c,v
retrieving revision 1.253
diff -u -r1.253 citytools.c
--- server/citytools.c  2004/02/19 20:01:07     1.253
+++ server/citytools.c  2004/02/22 16:59:34
@@ -697,7 +697,8 @@
    * it's more work. */
   punit2 = create_unit_full(to_player, punit->x, punit->y, punit->type,
                            punit->veteran, tocity->id, punit->moves_left,
-                           punit->hp, punit);
+                           punit->hp,
+                           find_unit_by_id(punit->transported_by));
 }
 
 /*********************************************************************

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