Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2004:
[Freeciv-Dev] Re: (PR#10726) a nuke can take an empty city
Home

[Freeciv-Dev] Re: (PR#10726) a nuke can take an empty city

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: ggracian@xxxxxxx
Subject: [Freeciv-Dev] Re: (PR#10726) a nuke can take an empty city
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Sat, 30 Oct 2004 05:43:15 -0700
Reply-to: rt@xxxxxxxxxxx

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

On Mon, 25 Oct 2004, Genevieve Gracian wrote:
> > On Mon, 25 Oct 2004, Genevieve Gracian wrote:
> > > When a city is empty, a nuke can take it (the nuke disapears when the
> > > the city popup appears). Cruise missiles cannot take cities.

Oops. Brown paper bag bug introduced by yours truly. Here is a patch.
Should be applied to both head and S2_0.

  - Per

Index: server/citytools.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/citytools.c,v
retrieving revision 1.277
diff -u -r1.277 citytools.c
--- server/citytools.c  19 Oct 2004 06:46:57 -0000      1.277
+++ server/citytools.c  30 Oct 2004 12:41:40 -0000
@@ -1202,8 +1202,10 @@
   struct player *pplayer = unit_owner(punit);
   struct player *cplayer = city_owner(pcity);
 
-  /* if not at war, may peacefully enter city */
-  if (!pplayers_at_war(pplayer, cplayer)) {
+  /* If not at war, may peacefully enter city. Or, if we cannot occupy
+   * the city, this unit entering will not trigger the effects below. */
+  if (!pplayers_at_war(pplayer, cplayer)
+      || !COULD_OCCUPY(punit)) {
     return;
   }
 

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