Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2003:
[Freeciv-Dev] (PR#4260) assertion in get_defender
Home

[Freeciv-Dev] (PR#4260) assertion in get_defender

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: kaufman@xxxxxxxxxxxxxxxxxxxxxx, kenn@xxxxxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#4260) assertion in get_defender
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 15 Aug 2003 08:48:39 -0700
Reply-to: rt@xxxxxxxxxxxxxx

[jdorje - Fri Aug 15 15:40:20 2003]:

> [jdorje - Fri Aug 15 15:35:08 2003]:
> 
> > [jdorje - Fri Aug 15 14:51:54 2003]:
> >
> > > This autogame was originally the one used to reproduce the
> > pending_seen bug.
> > >
> > > Now it crashes earlier:
> > >
> > > 1: get_defender bug: b's Battleship vs Palmiro Togliatti's
> Transport
> > > (total 2 units) on Ocean at (29,39).
> > >  > civserver: combat.c:626: get_defender: Assertion `0' failed.
> > > Aborted (core dumped)
> >
> > The battleship is attacking a transport.  The transport's tile
> > contains
> > a second unit - the Mech. Inf. from an allied player that is being
> > transported_by the transport.
> 
> Oh, and...
> 
> The battleship's owner (player 0) is in DS_ALLIANCE with the
> transport's
> owner (player 4), but has DS_NO_CONTACT with the Mech Inf's owner
> (player 18).

So, obviously the immediate problem is that the transport cannot be
attacked (it's allied).  The Mech Inf can be attacked, but cannot defend
here (we're on ocean).  Thus count==1 but bestdef==NULL.  The code to
catch this error may or may not be overzealous.

Then there's the question of why get_defender was called in the first
place.  Either get_defender should just return NULL, or it shouldn't be
called at all...

It should be pointed out the battleship is not adjacent to the
transport, so the allied-allied-nocontact scenario seems perfectly legal.

jason



[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#4260) assertion in get_defender, Jason Short <=