Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2001:
[Freeciv-Dev] Re: invalid city coords (PR#868)
Home

[Freeciv-Dev] Re: invalid city coords (PR#868)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Sebastian Bauer <sebauer@xxxxxxxxxxx>, freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: invalid city coords (PR#868)
From: Thue Janus Kristensen <thue@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 29 Jul 2001 22:33:50 +0200

On Sat, Jul 28, 2001 at 12:06:50PM -0700, Christian Knoke wrote:
> CVS ~ 20 July 2001
> 
> Friend of mine got a
> 
> "invalid city coords 2,5 in package"
> 
> server error.
> 
> Sorry, no more info. Just for the records.

Good enough.
The amiga people probably want to fix this too.

-Thue

diff -Nur -X/mnt/data/freeciv-dev/freeciv/diff_ignore 
freeciv/client/gui-gtk/citydlg.c codeciv/client/gui-gtk/citydlg.c
--- freeciv/client/gui-gtk/citydlg.c    Sun Jul 29 22:17:15 2001
+++ codeciv/client/gui-gtk/citydlg.c    Sun Jul 29 22:27:23 2001
@@ -1908,17 +1908,19 @@
     struct packet_city_request packet;
 
     city_get_map_xy(ev->x, ev->y, &xtile, &ytile);
-    packet.city_id=pcity->id;
-    packet.worker_x=xtile;
-    packet.worker_y=ytile;
-    packet.name[0]='\0';
-    packet.worklist.name[0] = '\0';
-    
-    if(pcity->city_map[xtile][ytile]==C_TILE_WORKER)
-      send_packet_city_request(&aconnection, &packet, 
+    if (is_valid_city_coords(xtile, ytile)) {
+      packet.city_id=pcity->id;
+      packet.worker_x=xtile;
+      packet.worker_y=ytile;
+      packet.name[0]='\0';
+      packet.worklist.name[0] = '\0';
+
+      if(pcity->city_map[xtile][ytile]==C_TILE_WORKER)
+       send_packet_city_request(&aconnection, &packet, 
                               PACKET_CITY_MAKE_SPECIALIST);
-    else if(pcity->city_map[xtile][ytile]==C_TILE_EMPTY)
-      send_packet_city_request(&aconnection, &packet, PACKET_CITY_MAKE_WORKER);
+      else if(pcity->city_map[xtile][ytile]==C_TILE_EMPTY)
+       send_packet_city_request(&aconnection, &packet, 
PACKET_CITY_MAKE_WORKER);
+    }
   }
   return TRUE;
 }


[Prev in Thread] Current Thread [Next in Thread]