[Freeciv-Dev] Re: (PR#13539) Fix AI tile effect miscalculation
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=13539 >
Per I. Mathisen wrote:
> <URL: http://bugs.freeciv.org/Ticket/Display.html?id=13539 >
>
> On Mon, 25 Jul 2005, Jason Short wrote:
>
>>I see the problem now.
>
>
> Good :-)
>
>
>>Since aicity hard-codes all the logic inside generic_city_refresh it
>>will have to hard-code this too.But this shouldn't be a new function in
>>city.c it should just go straight into aicity.c like all the other
>>logic.
>
> ...
>
>>Also I wouldn't assume that calling generic_city_refresh here will be
>>substantially slower.
>
> Calling full generic_city_refresh() will be substantially slower - I
> tested this before originally writing this code (although things have
> changed in city.c since then).
>
> With some more pre-game analysis of the ruleset we can rule out tile
> changes from most buildings, and take a different and faster code path.
>
> Untested patch attached. Does this look better?
OK. But you shouldn't use memcpy like that, since it depends on the
types being the same which could easily be changed...speaking of which
maybe the tile output should be changed to a 1-byte or 2-byte integer.
-jason
|
|