Complete.Org: Mailing Lists: Archives: freeciv-dev: June 2000:
[Freeciv-Dev] Re: handle_unit_attack_request
Home

[Freeciv-Dev] Re: handle_unit_attack_request

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Nicolas Brunel <brunel@xxxxxxxxxxxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: handle_unit_attack_request
From: Thue Janus Kristensen <thue@xxxxxxx>
Date: Sun, 4 Jun 2000 01:35:34 +0200

On Sun, 04 Jun 2000, Nicolas Brunel wrote:
> > The idea is that they should never have got that far, but should have
> > been caught in handle_unit_move_request(), which would have displayed a
> > normal error message. Those you see are just sanity checks.
> > 
> > -Thue
> 
> Compiled with gcc -E (and DNDEBUG), it gives
> 
>  do { if (( 0  ) != 3 ) { real_freelog(( 0  ),"Trying to attack a unit
> with which you have peace or cease-fire at %i, %i",
>             def_x, def_y ); } } while(0) ;
> 
>     abort();
> 
> I don't fully understand what happens in log.c. But, I'm almost sure
> civserver write your message, terminate and never reach your abort.

I think it does reach the abort(). I have used LOG_FATALs before
(as I am sure jjm is aware), and the server keeps running after writing
the message. In this case only down to the abort.
Also, that code looks like it does indeed reach the abort() to me.

> Well, it's only a cosmetic little change. It's true that it's more
> interesting to work on gotohand, fog of war, goto for planes and
> automated ferryboats! 

Well, small improvements and cleanups have their place too.

> Bye and happy coding,

Well, thanks :)
-Thue



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