<URL: http://bugs.freeciv.org/Ticket/Display.html?id=40316 >

pcity->tile and ptile->city are both set to the correct values.
> In general ptile->city->tile == ptile and pcity->tile->city == pcity
> all the time (that would be a useful assertion to add somewhere - in
> fact client-side sanity checks might be a good thing in general, but
> that's off topic).

There is the catch: Between the versions the ptile->city member has been
replaced by ptile->worked which points to the city working on the tile,
so many tiles are pointing to the same city (in the city radius I
suppose). That is what the tile_city function is all about (in S2_1 it
didn't exist and the put_one_element function got just passed
ptile->city), as it checks whether the tile that is worked on (if at
all) is the center tile of the city itself or if not returns NULL
(meaning it is just a tile in the vicinity of the given city and worked
by it). This worked member is used quite extensively for calculating the
owners of the tiles and their surrounding borders, so it seems to be
working quite fine. Only problem is that somewhere on the client (or
more likely on the server) this member isn't updated correctly, maybe
because somebody thought that the client shouldn't be supposed to know
about what tiles are worked by other players if they can't see it (hich
sounds quite sensible at first glance).


> Question: if you disconnect and reconnect to the server, are the
> fogged cities shown then?  I cannot recall testing this.

Wow, that was a GREAT idea! I just tested it and noticed that the cities
are updated correctly (meaning they are visible when fogged) after
rejoining the game. I moved up to one visible fogged city with an
explorer and left again et voila: once the city got fogged again it
disappeared from the map. The problem seems to occur when the fogged
city becomes visible again or is fogged again.  So the problem with the
updating must be happening somewhere when the TILE_KNOWN_UNSEEN flag is
set for a formerly seen tile or vice versa when it is reset to the
TILE_KNOWN_SEEN.

I'll try to check through all the code blocks where these status flags
are checked and/or changed and compare them with the former code of
S2_1. Maybe I'll get lucky and find the needle in the haystack before
the "few weeks" pass by. ;)

_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to