Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2002:
[Freeciv-Dev] Re: [PATCH] aiunit.c ai_manage_explorer cleanup (PR#1210)
Home

[Freeciv-Dev] Re: [PATCH] aiunit.c ai_manage_explorer cleanup (PR#1210)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Cc: bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [PATCH] aiunit.c ai_manage_explorer cleanup (PR#1210)
From: Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>
Date: Tue, 8 Jan 2002 08:27:59 -0800 (PST)

 --- Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> wrote: 
> On Mon, Jan 07, 2002 at 10:57:01PM +0100, Petr Baudis wrote:
> 
> > > > +      if (!handle_unit_move_request(punit, best_x, best_y,
> > > >                                              FALSE, FALSE)) {
> > > > +        /* This shouldn't happen */
> > > 
> > > Than add an assert(0);
> > There's no "this can't happen" - if it happens, it is still ok, we
> > aren't
> > assured anywhere it won't happen. See source of
> > handle_unit_move_request() and
> > you will see really many cases when return 0 is issued and most of
> > them aren't
> > fatal. I.e.:
> > 
> >     /* DO NOT Auto-attack.  Findvictim routine will decide if we
> >        should. */
> >     if (pplayer->ai.control && punit->activity == ACTIVITY_GOTO) {
> >       notify_player_ex(pplayer, punit->x, punit->y, E_NOEVENT,
> >                        _("Game: Aborting GOTO for AI attack
> >                                                procedures."));
> >       return 0;
> >     }
> > 
> > When I observe AI, I see this frequently. IMHO we would die really
> > soon with
> > assert(0) ;).
> 
> Than the comment is wrong.

Raimar stop picking at peoples comments.  If you want to be pedantic, the
comment can be changed to "it is unlikely to happen".  But even as it is,
the comment is informative and liguistically sound.  If it were "it
mustn't happen", then an assert would be in order.

Best,
G.

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com



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