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: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: handle_unit_attack_request
From: Thue Janus Kristensen <thue@xxxxxxx>
Date: Sun, 4 Jun 2000 00:42:47 +0200

On Sun, 04 Jun 2000, Nicolas Brunel wrote:
> If one player does not respect a cease-fire or a pact, civserver
> will abort ? I've got the feeling some lines are missing and other lines
> have to be deleted.
> 
>   if (players_non_attack(punit->owner, pdefender->owner)) {
>     freelog(LOG_FATAL,
>             "Trying to attack a unit with which you have peace or
> cease-fire at
> %i, %i",
>             def_x, def_y);
>     abort();
>   }
> 
>   if (players_allied(punit->owner, pdefender->owner)
>       && !(unit_flag(punit->type, F_NUCLEAR) && punit == pdefender)) {
>     freelog(LOG_FATAL,
>             "Trying to attack a unit with which you have allience at %i,
> %i",
>             def_x, def_y);
>     abort();
>   }
> 
> Bye,

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



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