Re: Unit within the radius of their home city don't

Per Inge Mathisen <per-0/[email protected]>
Newsgroups gmane.games.freeciv.general
Message-ID <[email protected]>
On Fri, 2 Jul 2004, Eddie Anderson wrote:
> >Seems like it should be based on the nation's borders.
>
>   Yes!  That would be even better. Although that could get
> complicated when a border runs through part of a city.

I don't see why that should be complicated. Just use the border and forget
the city.

Anyway, this would make fortresses almost completely useless, since they
are robbed of one of their major uses (keeping units happy in the field).
Not that anyone build fortresses...

>   Nevertheless, IMO almost anything that frees units from being
> stuck in the city centers would improve Freeciv.

Well, you can try it out. Here is a patch:

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);

  - Per
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.