Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2004:
[Freeciv-Dev] Re: (PR#9124) major ferry bug
Home

[Freeciv-Dev] Re: (PR#9124) major ferry bug

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: per@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#9124) major ferry bug
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 7 Jul 2004 10:33:10 -0700
Reply-to: rt@xxxxxxxxxxx

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

Per Inge Mathisen wrote:
> I'm nuking these lines to make
> cvs AI able to spread by boat again.

But you need to revert them not just delete them.  We have to do some 
sort of check.  (It doesn't matter with the current ruleset because 
ocean has the NoCities flag, but in an SMAC-like ruleset without these 
lines land units would be able to build cities in the ocean.)

jason

? data/tridenthex
? data/tridenthex.tilespec
Index: common/city.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/city.c,v
retrieving revision 1.223
diff -u -r1.223 city.c
--- common/city.c       7 Jul 2004 12:11:01 -0000       1.223
+++ common/city.c       7 Jul 2004 17:28:17 -0000
@@ -950,6 +950,18 @@
     return FALSE;
   }
 
+  if (punit) {
+    enum unit_move_type move_type = unit_type(punit)->move_type;
+    enum tile_terrain_type t = map_get_terrain(x, y);
+
+    /* We allow land units to build land cities and sea units to build
+     * ocean cities. */
+    if ((move_type == LAND_MOVING && is_ocean(t))
+       || (move_type == SEA_MOVING && !is_ocean(t))) {
+      return FALSE;
+    }
+  }
+
   /* game.rgame.min_dist_bw_cities minimum is 1, meaning adjacent is okay */
   square_iterate(x, y, game.rgame.min_dist_bw_cities-1, x1, y1) {
     if (map_get_city(x1, y1)) {

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