Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2002:
[Freeciv-Dev] Re: (PR#2493) Flag shown for empty city
Home

[Freeciv-Dev] Re: (PR#2493) Flag shown for empty city

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: ChrisK@xxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#2493) Flag shown for empty city
From: "Raimar Falke via RT" <rt@xxxxxxxxxxxxxx>
Date: Sat, 7 Dec 2002 03:00:50 -0800
Reply-to: rt@xxxxxxxxxxxxxx

On Thu, Dec 05, 2002 at 12:04:56PM -0800, ChrisK@xxxxxxxx via RT wrote:
> 
> 1.14beta CVS 05 DEC 2002 Gtk+ 1.2
> 
> An enemy city with no units inside is shown with
> a "flag" on the map (That is the small flag in the upper
> left corner of the city tile (Trident), how do you call it?)
> 
> Reproducible.
> 
> Get wrongflag.sav.gz from incoming. Login as chris.
> Attack Szeged with cruisers.
> 
> If it is not reproducible for you, I can provide a core dump
> (produced with kill -11) and the binary of civclient.

I can't reproduce this with 1.14.0-beta2.

I can reproduce this with CVS HEAD. The attached patch helps.

        Raimar

P.S.: please attach the savegame instead of putting it onto the FTP
server.

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "The BeOS takes the best features from the major operating systems. 
  It's got the power and flexibility of Unix, the interface and ease 
  of use of the MacOS, and Minesweeper from Windows."

Index: server/unittools.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/unittools.c,v
retrieving revision 1.199
diff -u -u -r1.199 unittools.c
--- server/unittools.c  2002/12/06 02:41:40     1.199
+++ server/unittools.c  2002/12/07 10:17:16
@@ -1823,6 +1823,10 @@
     city_refresh(pcity);
     send_city_info(city_owner(pcity), pcity);
   }
+  if (pcity && unit_list_size(&map_get_tile(punit_x, punit_y)->units) == 0) {
+    /* The last unit in the city was killed: update the occupied flag. */
+    send_city_info(NULL, pcity);
+  }
 }
 
 /**************************************************************************

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