[Freeciv-Dev] Re: Core is_tiles_adjacent
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
--- Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> wrote:
> On Fri, Oct 05, 2001 at 04:54:55PM +0100, Gregory Berkolaiko wrote:
> > --- Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> wrote:
> > > On Thu, Oct 04, 2001 at 03:36:46PM -0700, Paul Zastoupil wrote:
> > > > > Assertion failed: is_tiles_adjacent(punit->x, punit->y, x, y),
> file
> > > > unittools.c, line 3097
[..]
> >
> > The assert does not belong in there. I removed
> > if ( is_tiles_adjacent(punit->x, punit->y, x, y) )
> > not because they are always adjacent, but because there is this same
> > check in handle_unit_move_request which follows in 2 lines and it
> gives a
> > proper debug message and returns a proper fail value (actually not
> > proper, it returns 0) and it is caught and digested later in the
> code.
> >
> > And I did explain it in my submission email.
>
> Shame on me.
Actually praise on you. The assert should not have been there, but even
if it was it should not fail all that often. But it did, I became
suspicious and had a look at the code.
And discovered a most annoying bug!!
The goto in interactive mode just didn't work. I didn't catch it before
because I only tested the autogames and ai doesn't use goto proper.
Anyway, the attached patch should fix both assert and the buggy
behaviour.
The problem was that function would return earlier than all the
neccessary updates were done.
Sorry, mea culpa...
G.
P.S. Seemingly random distribution of checks through the procedure is
done to comply with the ordering detailed in
http://www.freeciv.org/lxr/source/server/gotohand.h?v=cvs#L19
____________________________________________________________
Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie
oops.diff
Description: oops.diff
- [Freeciv-Dev] Core is_tiles_adjacent, Paul Zastoupil, 2001/10/04
- [Freeciv-Dev] Re: Core is_tiles_adjacent, Paul Zastoupil, 2001/10/04
- [Freeciv-Dev] Re: Core is_tiles_adjacent, Raimar Falke, 2001/10/05
- [Freeciv-Dev] Re: Core is_tiles_adjacent, Gregory Berkolaiko, 2001/10/05
- [Freeciv-Dev] Re: Core is_tiles_adjacent, Raimar Falke, 2001/10/05
- [Freeciv-Dev] More maintainers please!!! (was: Re: Core is_tiles_adjacent), Gregory Berkolaiko, 2001/10/05
- [Freeciv-Dev] Re: More maintainers please!!! (was: Re: Core is_tiles_adjacent), Raimar Falke, 2001/10/05
- [Freeciv-Dev] Re: More maintainers please!!! (was: Re: Core is_tiles_adjacent), Gregory Berkolaiko, 2001/10/05
- [Freeciv-Dev] Re: More maintainers please!!! (was: Re: Core is_tiles_adjacent), Ross W. Wetmore, 2001/10/09
- [Freeciv-Dev] Re: More maintainers please!!! (was: Re: Core is_tiles_adjacent), Gaute B Strokkenes, 2001/10/05
- [Freeciv-Dev] Re: Core is_tiles_adjacent,
Gregory Berkolaiko <=
|
|