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]
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
|
|