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

[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: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Sun, 18 May 2003 12:38:58 -0700
Reply-to: rt@xxxxxxxxxxxxxx

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

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.

Neither I nor Greg are going to fix this right now, so I suggest you just
pick a solution and commit it.

  - Per

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