[Freeciv-Dev] Re: (PR#9124) major ferry bug
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<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)) {
|
|