[Freeciv-Dev] Re: (PR#10459) bug: pplayer_can_ally assert fail
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=10459 >
Per I. Mathisen wrote:
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=10459 >
>
> Found it. We did not properly check that the players we sanity checked
> were alive. So there was no actual bug, since pplayers_can_ally() would
> not be called by dead players, except by sanity_check().
>
> I changed a few other things, too, that could be bug prone.
Yay.
> Index: common/player.c
> ===================================================================
> RCS file: /home/freeciv/CVS/freeciv/common/player.c,v
> retrieving revision 1.158
> diff -u -r1.158 player.c
> --- common/player.c 8 Oct 2004 05:11:51 -0000 1.158
> +++ common/player.c 18 Oct 2004 14:26:28 -0000
> @@ -44,6 +44,9 @@
> ***************************************************************/
> bool pplayer_can_ally(struct player *p1, struct player *p2)
> {
> + if (!p1->is_alive || !p2->is_alive) {
> + return TRUE;
> + }
This seems wrong. If !pplayer->is_alive then player_can_ally should be
false. Then sanity checking should just skip dead players.
jason
- [Freeciv-Dev] Re: (PR#10459) bug: pplayer_can_ally assert fail, Per I. Mathisen, 2004/10/15
- [Freeciv-Dev] (PR#10459) bug: pplayer_can_ally assert fail, Jason Short, 2004/10/17
- [Freeciv-Dev] Re: (PR#10459) bug: pplayer_can_ally assert fail, Per I. Mathisen, 2004/10/18
- [Freeciv-Dev] Re: (PR#10459) bug: pplayer_can_ally assert fail,
Jason Short <=
- [Freeciv-Dev] Re: (PR#10459) bug: pplayer_can_ally assert fail, Per I. Mathisen, 2004/10/18
- [Freeciv-Dev] Re: (PR#10459) bug: pplayer_can_ally assert fail, Jason Short, 2004/10/18
- [Freeciv-Dev] Re: (PR#10459) bug: pplayer_can_ally assert fail, Jason Short, 2004/10/18
- [Freeciv-Dev] Re: (PR#10459) bug: pplayer_can_ally assert fail, Per I. Mathisen, 2004/10/18
- [Freeciv-Dev] Re: (PR#10459) bug: pplayer_can_ally assert fail, Jason Short, 2004/10/18
- [Freeciv-Dev] Re: (PR#10459) bug: pplayer_can_ally assert fail, Marko Lindqvist, 2004/10/19
|
|