Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2003:
[Freeciv-Dev] Re: (PR#4260) get_defender bug
Home

[Freeciv-Dev] Re: (PR#4260) get_defender bug

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: kaufman@xxxxxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#4260) get_defender bug
From: "Gregory Berkolaiko" <Gregory.Berkolaiko@xxxxxxxxxxxx>
Date: Mon, 19 May 2003 04:59:58 -0700
Reply-to: rt@xxxxxxxxxxxxxx

On Sun, 18 May 2003, Per I. Mathisen wrote:

> On Sun, 18 May 2003, Mike Kaufman wrote:
> > 1: get_defender bug: Gro Harlem Brundtland's Archers vs Tassilo III's
> > Archers (total 4 units) on Ocean at (9,36).
> > > civserver: combat.c:514: get_defender: Assertion `0' failed.
> > Aborted (core dumped)
> >
> > #00x400e3021 in __kill () at __kill:-1
> > #10x400e2ca8 in raise (sig=1075741620) at ../sysdeps/posix/raise.c:27
> > #20x400e456c in *__GI_abort () at ../sysdeps/generic/abort.c:88
> > #30x400dc01a in *__GI___assert_fail (assertion=0x0, file=0x0, line=0,
> >   function=0x80f0489 "get_defender") at assert.c:83
> > #40x080a197b in get_defender (attacker=0x8687738, x=9, y=36) at
> > combat.c:514
> > #50x080d003f in find_something_to_kill (pplayer=0x817e088,
> > punit=0x8687738,
> >   x=0xbffffb54, y=0xbffffb58) at aiunit.c:2229
> 

I believe it's normally caused by units in a transport belonging to 
another player.  Mike, is it the case here?

> Yes. This has been discussed before but we didn't agree on a short-term
> fix. It was introduced by Greg's fstk cleanup. I suggested adding a call
> to can_unit_attack_unit_at_tile() before this call to get_defender(). The
> bug is that we try to attack units on board a ferry, which does not yield
> a valid defender. Greg's suggested short-term fix was AFAICT removing the
> assert in get_defender(). Both will do as a kludge.

I think Per's suggestion is not a kludge and should be done anyway.  Mike, 
please add
 if (!can_unit_attack_unit_at_tile(punit, aunit, aunit->x, aunit->y) {
   continue;
 }

on line 2228 in aunit.c

G.




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