[Freeciv-Dev] Re: (PR#8854) remove some specialist references
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: |
undisclosed-recipients: ; |
Subject: |
[Freeciv-Dev] Re: (PR#8854) remove some specialist references |
From: |
"Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx> |
Date: |
Fri, 28 May 2004 10:15:50 -0700 |
Reply-to: |
rt@xxxxxxxxxxx |
<URL: http://rt.freeciv.org/Ticket/Display.html?id=8854 >
Raimar Falke wrote:
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=8854 >
>
> On Thu, May 27, 2004 at 05:52:49PM -0700, Jason Short wrote:
>
> /* First try to kill off the specialists */
> while (pop_loss > 0 && city_specialists(pcity) > 0) {
> - if (pcity->specialists[SP_TAXMAN] > 0) {
> - pcity->specialists[SP_TAXMAN]--;
> - } else if (pcity->specialists[SP_SCIENTIST] > 0) {
> - pcity->specialists[SP_SCIENTIST]--;
> - } else {
> - assert(pcity->specialists[SP_ELVIS] > 0);
> - pcity->specialists[SP_ELVIS]--;
> + /* This loop could be more efficient. */
> + for (i = SP_COUNT - 1; i >= 0; i--) {
> + if (pcity->specialists[i] > 0) {
> + pcity->specialists[i]--;
> + pop_loss--;
> + break;
> + }
>
> Here you loose information. You have to define an order/importance for
> each specialist. You encode this information in the SP_* index. This
> is bad.
But this is already the case! In any case the ordering doesn't really
matter. If the player has famine he shouldn't get too much say about
who gets killed. It might even be better to make it random.
jason
|
|