[Freeciv-Dev] Re: server/cityturn.c - surplus food when settlers (units
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Saturday 23 June 2001 07:05, Michael Zinn wrote:
> The problem: when settlers are built, the city they are built in consumes
> needs the food for both the settler *and* the extra head of population for
> that turn
>
> More details are in the inserted `patch' below, which isn't really a patch
> but rather an opportunity to put the problem in context and describe it in
> more detail :P
>
> Attached is also a "patch" which `ought' to work, but seems a little too
> obvious, again, as discussed in the comment below.
+ /* Here's where I suspect the fix would be...
+ * what happens is, create_unit does the whole refresh_city thing,
which
+ * includes a set_food_trade_shields and a city_support which together
+ * set the pcity->food_surplus.
+ * The problem with this is, that for this turns food surplus purposes,
+ * the player is paying for *both* the extra head of population *and*
+ * the settler (ie an F_CITIES unit), which is not really what should
+ * happend.
What really is the problem is that we do not call city_refresh() again after
removing the citizen. So the city fields are out of sync with reality.
Your fix works too, but adding the refresh to to city_auto_remove_worker() is
nicer because it makes the function safe for everybody.
There isn't anything obvious you have missed. I recently added the
city_refresh to create_unit(), which then caused this bug.
-Thue
|
|