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

2008/7/28 Nicolas R. Wadhwani:
>
>>  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.

 There's separate discussion about how to best handle owner
information of fogged tiles. I leave that part out until we know how
to really implement it. Modified version of your patch attached.


 -  ML

diff -Nurd -X.diff_ignore freeciv/server/maphand.c freeciv/server/maphand.c
--- freeciv/server/maphand.c    2008-07-06 17:49:05.000000000 +0300
+++ freeciv/server/maphand.c    2008-08-01 20:30:08.000000000 +0300
@@ -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))
                    : 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
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to