Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2004:
[Freeciv-Dev] (PR#9169) Units happy inside borders
Home

[Freeciv-Dev] (PR#9169) Units happy inside borders

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#9169) Units happy inside borders
From: "Per Inge Mathisen" <per@xxxxxxxxxxx>
Date: Sat, 3 Jul 2004 08:06:43 -0700
Reply-to: rt@xxxxxxxxxxx

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

This patch makes units to not cause unhappiness when they are inside their
own borders, when borders are used.

  - Per

Index: common/unit.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/unit.c,v
retrieving revision 1.211
diff -u -r1.211 unit.c
--- common/unit.c       25 Jun 2004 23:29:59 -0000      1.211
+++ common/unit.c       3 Jul 2004 14:53:05 -0000
@@ -1639,6 +1639,10 @@
     return FALSE;
   if (map_get_city(punit->x,punit->y))
     return FALSE;
+  if (game.borders > 0 
+      && map_get_owner(punit->x, punit->y) == unit_owner(punit)) {
+    return FALSE;
+  }
   if (is_ground_unit(punit) &&
       map_has_special(punit->x, punit->y, S_FORTRESS))
     return !is_unit_near_a_friendly_city (punit);

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