Re: (PR#12422) stupid AI leaves its city in disorder
"Jason Short" <[email protected]> Sat, 5 Mar 2005 14:42:19 -0800
| Newsgroups | gmane.games.freeciv.ai |
|---|---|
| Message-ID | <[email protected]> |
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=12422 > Benoit Hudson wrote: > cm_query_result should never be clobbering the city; I had noted that > your patch was buggy in #11415 and offered a patch but probably you > didn't see it since apparently the bug was already marked closed. You can argue that the current behavior (where cm_query_result calls generic_city_refresh before "saving" the city value) is buggy. But you can also argue that any other behavior is also buggy. If the query is passed in an un-refreshed city it must do a full refresh of the city before beginning any calculations. This refresh doesn't have to be "saved" (we could restore the old value afterwards) but then we have the problem that the unrefreshed city is just passed on to the next caller (again a bug). The only real "solution" that doesn't have cm_query_result ever clobber the city is to *require* that all cities be passed in refreshed. -jason