Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2001:
[Freeciv-Dev] Re: [PATCH] city_landlocked_sell_coastal_improvements gene
Home

[Freeciv-Dev] Re: [PATCH] city_landlocked_sell_coastal_improvements gene

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Cc: bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [PATCH] city_landlocked_sell_coastal_improvements generalisation (PR#1105)
From: jdorje@xxxxxxxxxxxxxxxxxxxxx
Date: Sat, 8 Dec 2001 19:52:01 -0800 (PST)

Ben Webb wrote:

When a city becomes landlocked due to terrain transformations, the city_landlocked_sell_coastal_improvements() function automatically sells the B_HARBOUR, B_PORT, B_COASTAL and B_OFFSHORE buildings, which have become redundant. The attached patch replaces this hardcoded behaviour by instead selling any building that is defined in buildings.ruleset with
terr_gate = "Ocean"
and
spec_gate = ""

i.e. any building that can only be built if Ocean squares are nearby. Wonders are not automatically sold, however (it's not clear to me why the Lighthouse isn't restricted to being built only in coastal cities anyway, but I suspect that most players wouldn't want their Wonders auto-sold).

Since the original loop over the four hardcoded building types has been replaced with a loop over all types, this code would be expected to run slightly more slowly. However, it is called so infrequently that this extra CPU usage is negligible.

Seems straightforward.

BTW: is it even possible to sell wonders?

jason




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