Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2003:
[Freeciv-Dev] Re: (PR#725) Production upgrade of newly-researched units
Home

[Freeciv-Dev] Re: (PR#725) Production upgrade of newly-researched units

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: ChrisK@xxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#725) Production upgrade of newly-researched units deferred
From: "Joona Kiiski via RT" <rt@xxxxxxxxxxxxxx>
Date: Fri, 17 Jan 2003 14:10:07 -0800
Reply-to: rt@xxxxxxxxxxxxxx

On Fri, Jan 17, 2003 at 01:23:33PM -0800, ChrisK@xxxxxxxx via RT wrote:
> BTW: It happens sometimes that a building is sold, when it is not
> really necessary.
> 
> Christian

If this is seen as a problem, the solution is quite simple
(this idea follows Jason's patch):

1) make pay_for_buildings not to sell any buildings. Instead allow
   gold get negative value (temporarily)

2) Add one more city_iterate_loop in Jason's patch, right after
   pay_for_buildings loop, which is executed only if gold is negative.
   It goes through cities and sells buildings if necessary (and returns
   upkeep-payment).

But the question is... How to make 2) to sell the most worthless
building? Simple iteration would mean, that algorithm would end up
selling all buildings in your capital first! (Most likely not what you
want ;))

-- 
Joona Kiiski <joona.kiiski@xxxxxx>



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