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

 City information is not copied from player map to player map with
shared vision treaty. Instead dest player gets just initialized site
structure.

 Fix attached


 - ML

diff -Nurd -X.diff_ignore freeciv/server/maphand.c freeciv/server/maphand.c
--- freeciv/server/maphand.c	2009-02-26 21:16:19.000000000 +0200
+++ freeciv/server/maphand.c	2009-03-06 16:08:10.000000000 +0200
@@ -1055,11 +1055,11 @@
       dest_tile->bases    = from_tile->bases;
       dest_tile->last_updated = from_tile->last_updated;
       send_tile_info(pdest->connections, ptile, FALSE);
-	
+
       /* update and send city knowledge */
       /* remove outdated cities */
-      if (dest_tile->site && dest_tile->site->location == ptile) {
-	if (!from_tile->site || from_tile->site->location != ptile) {
+      if (dest_tile->site) {
+	if (!from_tile->site) {
 	  /* As the city was gone on the newer from_tile
 	     it will be removed by this function */
 	  reality_check_city(pdest, ptile);
@@ -1073,13 +1073,12 @@
       }
 
       /* Set and send new city info */
-      if (from_tile->site && from_tile->site->location == ptile) {
-	if (!dest_tile->site || dest_tile->site->location != ptile) {
-	  change_playertile_site(dest_tile, NULL);
-
+      if (from_tile->site) {
+	if (!dest_tile->site) {
           /* We cannot assign new vision site with change_playertile_site(),
            * since location is not yet set up for new site */
-          dest_tile->site = create_vision_site(0, NULL, NULL);
+          dest_tile->site = create_vision_site(0, ptile, NULL);
+          *dest_tile->site = *from_tile->site;
 	}
         /* Note that we don't care if receiver knows vision source city
          * or not. */
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to