Complete.Org: Mailing Lists: Archives: freeciv: February 2006:
[Freeciv] Re: empty treasury and negative income
Home

[Freeciv] Re: empty treasury and negative income

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv@xxxxxxxxxxx
Subject: [Freeciv] Re: empty treasury and negative income
From: nicholas.g.lawrence@xxxxxxxxxxxxxxxxxxxx
Date: Fri, 17 Feb 2006 09:56:49 +1000


freeciv-bounce@xxxxxxxxxxx wrote on 16/02/2006 02:53:24 PM:

> Daniel Markstedt wrote:
> > What is effect of having an empty treasury and negative income at the
> > same time?

> Buildings get sold.  This increases both income and treasury. With unit
> upkeeps I assume the unit would simply be disbanded if it can't be paid
for.

> There is a minor bug (part of PR#724 IIRC) in that upkeep is done
> city-by-city instead of player-by-player.  So it's possible that you
> have a city with -5 income that gets calculated first and has to sell a
> building, even though your other city with a +50 income could easily pay
> for it.  Thus the order of city iteration matters.

> -jason

The fix is to split upkeep into two phases. Incomings and Outgoings.

Incomings is where a city earns money (eg trade). Iterate through all
the cities, adding the incomings to the central treasury.

Outgoings is where a city spends money (eg building upkeep). Iterate
through
all the cities, deducting outgoings from the central treasury.

nick


************************************************************
Opinions contained in this e-mail do not necessarily reflect
the opinions of the Queensland Department of Main Roads,
Queensland Transport or Maritime Safety Queensland, or
endorsed organisations utilising the same infrastructure.
If you have received this electronic mail message in error,
please immediately notify the sender and delete the message
from your computer.
************************************************************



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