Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2002:
[Freeciv-Dev] Re: (PR#2392) Occupied flag isn't removed if the city gets
Home

[Freeciv-Dev] Re: (PR#2392) Occupied flag isn't removed if the city gets

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#2392) Occupied flag isn't removed if the city gets empty
From: "Raimar Falke via RT" <rt@xxxxxxxxxxxxxx>
Date: Sat, 7 Dec 2002 03:01:25 -0800
Reply-to: rt@xxxxxxxxxxxxxx

On Sat, Nov 23, 2002 at 02:16:18PM -0800, Raimar Falke via RT wrote:
> 
> 
> Attack with the ship the city Milano. Try to attack with the other
> ship the city: the city is empty. But the flag is still there.

And the fix.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "These download files are in Microsoft Word 6.0 format. After
  unzipping, these files can be viewed in any text editor, including
  all versions of Microsoft Word, WordPad, and Microsoft Word Viewer."
    -- http://www.microsoft.com/hwdev/pc99.htm

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]
  • [Freeciv-Dev] Re: (PR#2392) Occupied flag isn't removed if the city gets empty, Raimar Falke via RT <=