This is the mail archive of the
xconq7@sources.redhat.com
mailing list for the Xconq project.
Re: Death of an advanced unit
- From: Hans Ronne <hronne at pp dot sbbs dot se>
- To: Lincoln Peters <peters2000 at mindspring dot com>
- Cc: xconq7 at sources dot redhat dot com
- Date: Tue, 18 Jun 2002 22:39:26 +0200
- Subject: Re: Death of an advanced unit
>Recently, I sent a bug report that stated that in Xconq 7.4.1, I found
>that it segfaulted whenever an advanced unit was destroyed by something
>other than starvation. I later reported that the problems stopped when
>I tried the CVS sources (7.5pre). I have some new information now.
>
>It seems that the segfault occurs if an advanced unit is destroyed by
>something other than starvation (combat, hp-to-garrison, etc.), but not
>if the unit is under construction. I think that Hans Ronne noted that
>the segfaults were most likely tied to terrain usage, which would
>explain why it doesn't segfault if the advanced units is incomplete (at
>that point, it's not using the terrain for anything).
This is weird. I checked to code, and terrain usage is always cleaned up
for advanced units irrespective of how they die. The same code is used in
all cases including starvation (kill_unit_aux). So this can't be the reason
for your crashes. Was this in the game where advanced units also were
mobile? As I mentioned earlier, the unit move code cannot yet handle
terrain usage, so if the unit first moves and then dies, we may end up with
NULL pointers being dereferenced.
The key question is therefore if you see this only with moving advanced units.
Hans
Hans Ronne
hronne@pp.sbbs.se