Complete.Org: Mailing Lists: Archives: freeciv-ai: March 2005:
[freeciv-ai] Re: (PR#12422) stupid AI leaves its city in disorder

[freeciv-ai] Re: (PR#12422) stupid AI leaves its city in disorder

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Subject: [freeciv-ai] Re: (PR#12422) stupid AI leaves its city in disorder
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Sat, 5 Mar 2005 03:41:28 -0800
Reply-to: bugs@xxxxxxxxxxx

<URL: >

On Fri, 4 Mar 2005, Jason Short wrote:
> The assert is surely not correct.Because the callers pass in cities
> that aren't refreshed the refresh _will_ sometimes change this value.

This should only happen in the client. In the server, cities should always
be properly refreshed when some part of the code is done with them.

> I also find it unlikely that generic_city_refresh is wrong here - this
> function is called so often if it were wrong the whole game would
> explode.
> However there is certainly a bug in ai_manage_taxes.I think this patch
> fixes it (the comment explains the bug).I think it's in S2_0 as well.

+       /* Must refresh to restore the original values (which were clobbered
+        * in cm_query_result, after the tax rates were changed). */
+       generic_city_refresh(pcity, TRUE, NULL);

Ah. This makes sense. However, I still think that the behaviour of
cm_query_result() is broken in this regard - a query should never change
the city. I guess we agree on this, and that the generic_city_refresh()
should be removed eventually.

I do not like the fix much, as it slows down this part of the code a lot,
but I guess it is the only way to be sure.

  - Per

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