Complete.Org: Mailing Lists: Archives: freeciv-dev: January 1999:
Re: [Freeciv-Dev] PATCH: Minor improvements to server/gotohand.c.
Home

Re: [Freeciv-Dev] PATCH: Minor improvements to server/gotohand.c.

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Tony & <stuckey@xxxxxxxxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxxx
Subject: Re: [Freeciv-Dev] PATCH: Minor improvements to server/gotohand.c.
From: ct <ct@xxxxxxxxxxxxxxx>
Date: Tue, 5 Jan 1999 12:07:36 +0000 (GMT)

On Tue 05 Jan, Tony & wrote:
>       There is some code in server/gotohand.c which I find obtuse.  This
> clarifies matters and should perform slightly better.

And then suggested:

> -  if (punit && unit_flag(punit->type, F_IGTER)) igter++;
> -  if (punit && punit->type == U_SETTLERS) maxcost >>= 1;
> +  if (punit) {
> +    if(unit_flag(punit->type, F_IGTER)) igter++;
> +    else if (punit->type == U_SETTLERS) maxcost >>= 1;
> +    }

But these two don't do the same thing, and the former allows for both
to happen. Removing the 'else' should fix that. Assuming I've read it
correctly, there isn't any reason a settler couldn't be given allowed
to ignore terrain for some alternative set of pieces.

regards, ct



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