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


In current trunk version if you capture an enemy city it still looks like it 
would belong to the previous owner before you captured it. Only if you would 
quit the game and rejoin/reload the captured city would appear in your city 
list and become accesible for changing the worklist, worker placement etc.

This is because the handle_city_info function depends on noticing a change of 
owners between the current known owner of a tile and the new owner of the 
city sent by the server. However, this change of ownership is currently 
handled by handle_tile_info previously before the city info packet arrives. 
The result is that the borders and all are calculated correcty and updated 
immediately, but once the new packet for the change of the city ownership 
comes in the client assumes the owner remained the same because the tile 
already belongs to the player the server is sending as new owner.

This problem could probably alternatively solved by changing the order in 
which the packets are send by the server, but this would be a bit more 
complicated and inhibits the risk of messing up something I just don't see 
now that crucialy depends on updating the tiles before the cities or I dunno 
what else.


diff -Nur -X.diff_ignore trunk/client/packhand.c changed/client/packhand.c
--- trunk/client/packhand.c	2008-07-24 23:06:22.000000000 +0200
+++ changed/client/packhand.c	2008-07-27 02:53:44.000000000 +0200
@@ -2248,7 +2248,7 @@
   /* always called after setting terrain */
   tile_set_resource(ptile, presource);
-  if (tile_owner(ptile) != powner) {
+  if (tile_owner(ptile) != powner && !tile_city(ptile)) {
     tile_set_owner(ptile, powner);
     tile_changed = TRUE;
Freeciv-dev mailing list

Reply via email to