Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2004:
[Freeciv-Dev] (PR#10525) grid isn't updated when cities are conquered
Home

[Freeciv-Dev] (PR#10525) grid isn't updated when cities are conquered

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#10525) grid isn't updated when cities are conquered
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 17 Oct 2004 23:46:49 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=10525 >

> [jdorje - Wed Oct 13 23:34:02 2004]:
> 
> A few of my cities were conquered (well, all of them really, but only a 
> few at a time).
> 
> In this screenshot I (the Egyptians) have just lost Ammonium and 
> Pelusium.  And the grid hasn't been updated properly.  Of course if I 
> force the whole thing to be redrawn, it'll be drawn correctly.

This will happen in non-iso view any time a city is conquered (if the
grid is on)!  This patch should fix it.

jason

Index: client/packhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/packhand.c,v
retrieving revision 1.408
diff -u -r1.408 packhand.c
--- client/packhand.c   1 Oct 2004 17:40:27 -0000       1.408
+++ client/packhand.c   18 Oct 2004 06:46:20 -0000
@@ -583,10 +583,13 @@
     /* We have to make sure we update any workers on the map grid, then
      * redraw the city descriptions on top of them.  So we calculate the
      * rectangle covered by the city's map, and update that.  Then we
-     * queue up a city description redraw for later. */
+     * queue up a city description redraw for later.
+     *
+     * HACK: The +2 below accounts for grid lines that may actually be on a
+     * tile outside of the city radius. */
     int canvas_x, canvas_y;
-    int width = get_citydlg_canvas_width();
-    int height = get_citydlg_canvas_height();
+    int width = get_citydlg_canvas_width() + 2;
+    int height = get_citydlg_canvas_height() + 2;
 
     (void) tile_to_canvas_pos(&canvas_x, &canvas_y, pcity->tile);
 

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