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

>  tile_city() returns real current situation. Instead server should
> send to client what player knows. Player may think there is a city in
> fogged tile, when in reality city has been destroyed since last seen,
> or new city has been founded to tile that previously had none.
>  Player knowledge should be available from player_tile. Cities are one
> kind of vision_site, I think.

That means that the way the owner is communicated by the server on fogged 
tiles is currently also wrong, as it uses the tile_owner function returning 
also the real current situation and not what the client is supposed to know. 
I haven't realised up till now that the borders are also updated on fogged 
tiles despite not having sent units to recon the new changes. I tried to 
solve this right along when getting the cities working, however the owner 
member of the vision_site struct seems not beeing set correctly at some other 
place in the code, while the identity member seems to be working just like it 
should be. So when applying this patch you would see the borders only on not 
fogged tiles. I'm still trying for the right place in the code to set the 
owner property, but as I don't have much of a clue I'm open for suggestions 
as always. ;)


diff -Nur -X.diff_ignore trunk/server/maphand.c changed/server/maphand.c
--- trunk/server/maphand.c	2008-07-27 21:44:04.000000000 +0200
+++ changed/server/maphand.c	2008-07-27 23:32:28.000000000 +0200
@@ -406,13 +406,16 @@
     } else if (pplayer && map_is_known(ptile, pplayer)
 	       && map_get_seen(ptile, pplayer, V_MAIN) == 0) {
       struct player_tile *plrtile = map_get_player_tile(ptile, pplayer);
+      struct vision_site *psite = map_get_player_base(ptile, pplayer);
       info.known = TILE_KNOWN_UNSEEN;
       info.continent = tile_continent(ptile);
-      info.owner = (NULL != tile_owner(ptile))
-                   ? player_number(tile_owner(ptile))
+      info.owner = (NULL != psite && NULL != psite-> owner)
+                   ? player_number(psite->owner)
                    : MAP_TILE_OWNER_NULL;
-      info.worked = IDENTITY_NUMBER_ZERO;
+      info.worked = (NULL != psite)
+                    ? psite->identity
+                    : IDENTITY_NUMBER_ZERO;
       info.terrain = (NULL != plrtile->terrain)
                       ? terrain_number(plrtile->terrain)
Freeciv-dev mailing list

Reply via email to