Complete.Org: Mailing Lists: Archives: freeciv-dev: June 2004:
[Freeciv-Dev] Re: (PR#8908) endgame numbers
Home

[Freeciv-Dev] Re: (PR#8908) endgame numbers

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: chrisk@xxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#8908) endgame numbers
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 4 Jun 2004 16:12:23 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=8908 >

andrearo@xxxxxxxxxxxx wrote:
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=8908 >
> 
> Here's a patch. It fixes the bug with the population.
> The patch also adds flags to each player in the list,
> and outlines the current player in the list. Gtk1/2 support.
> Screenshot:   http://www.stud.ntnu.no/~andrearo/endgame_screen.png

> diff -ruN -Xfreeciv-cvs-Jun-03/diff_ignore freeciv-cvs-Jun-03/server/report.c 
> freeciv-cvs-Jun-03-endgame/server/report.c
> --- freeciv-cvs-Jun-03/server/report.c        2004-05-12 07:12:44.000000000 
> +0200
> +++ freeciv-cvs-Jun-03-endgame/server/report.c        2004-06-04 
> 19:03:34.000000000 +0200
> @@ -1134,7 +1134,7 @@
>    for (i = 0; i < j; i++) {
>      packet.id[i] = size[i].player->player_no;
>      packet.score[i] = size[i].value;
> -    packet.pop[i] = get_pop(size[i].player) * 1000; 
> +    packet.pop[i] = get_population(size[i].player); 
>      packet.bnp[i] = get_economics(size[i].player); 
>      packet.mfg[i] = get_production(size[i].player); 
>      packet.cities[i] = get_cities(size[i].player); 

I'm not so sure that this is a bug.  Or rather...

I'm not so sure that it's correct to include the total population here. 
  The existing code reports the total number of citizens, times 1000. 
The total population is calculated quite differently since a size n city 
has population 5000n(n+1) - the nth citizen counts as 10,000n people.

However should we be reporting the population in people or in citizens 
here?  Of course if we do it in citizens we shouldn't be multiplying by 
1000.

Also I'm not sure if get_population is the right function to call to get 
the population.  It recoveres the population from the score struct.  But 
if this data hasn't been updated then it may be wrong.  In that case it 
would be better to call civ_population().

jason




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