Author: sveinung
Date: Wed Apr  1 23:46:51 2015
New Revision: 28687

URL: http://svn.gna.org/viewcvs/freeciv?rev=28687&view=rev
Log:
Move the rule that a city can't be founded on non native terrain to the ruleset.

See patch #5977

Modified:
    trunk/common/city.c
    trunk/data/alien/game.ruleset
    trunk/data/civ1/game.ruleset
    trunk/data/civ2/game.ruleset
    trunk/data/civ2civ3/game.ruleset
    trunk/data/classic/game.ruleset
    trunk/data/experimental/game.ruleset
    trunk/data/multiplayer/game.ruleset
    trunk/doc/README.actions
    trunk/fc_version
    trunk/server/rscompat.c

Modified: trunk/common/city.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/city.c?rev=28687&r1=28686&r2=28687&view=diff
==============================================================================
--- trunk/common/city.c (original)
+++ trunk/common/city.c Wed Apr  1 23:46:51 2015
@@ -1405,9 +1405,14 @@
     return CB_BAD_CITY_TERRAIN;
   }
 
-  if (punit && !can_unit_exist_at_tile(punit, ptile)) {
-    /* We allow land units to build land cities and sea units to build
-     * ocean cities. Air units can build cities anywhere. */
+  if (punit && !can_unit_exist_at_tile(punit, ptile)
+      /* TODO: remove CB_BAD_UNIT_TERRAIN and CB_BAD_UNIT_TERRAIN when it
+       * can be done without regressions. */
+      /* The ruleset may allow founding cities on non native terrain. */
+      && !utype_can_do_act_when_ustate(unit_type(punit), ACTION_FOUND_CITY,
+                                       USP_TRANSP_DEP, TRUE)) {
+    /* Many rulesets allow land units to build land cities and sea units to
+     * build ocean cities. Air units can build cities anywhere. */
     return CB_BAD_UNIT_TERRAIN;
   }
 

Modified: trunk/data/alien/game.ruleset
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/alien/game.ruleset?rev=28687&r1=28686&r2=28687&view=diff
==============================================================================
--- trunk/data/alien/game.ruleset       (original)
+++ trunk/data/alien/game.ruleset       Wed Apr  1 23:46:51 2015
@@ -330,6 +330,7 @@
 actor_reqs    =
     { "type",   "name", "range", "present"
       "Unitflag", "Cities", "Local", TRUE
+      "UnitState", "TransportDependent", "Local", FALSE
     }
 
 [actionenabler_join_city]

Modified: trunk/data/civ1/game.ruleset
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/civ1/game.ruleset?rev=28687&r1=28686&r2=28687&view=diff
==============================================================================
--- trunk/data/civ1/game.ruleset        (original)
+++ trunk/data/civ1/game.ruleset        Wed Apr  1 23:46:51 2015
@@ -315,6 +315,7 @@
 actor_reqs    =
     { "type",   "name", "range", "present"
       "Unitflag", "Cities", "Local", TRUE
+      "UnitState", "TransportDependent", "Local", FALSE
     }
 
 [actionenabler_join_city]

Modified: trunk/data/civ2/game.ruleset
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/civ2/game.ruleset?rev=28687&r1=28686&r2=28687&view=diff
==============================================================================
--- trunk/data/civ2/game.ruleset        (original)
+++ trunk/data/civ2/game.ruleset        Wed Apr  1 23:46:51 2015
@@ -369,6 +369,7 @@
 actor_reqs    =
     { "type",   "name", "range", "present"
       "Unitflag", "Cities", "Local", TRUE
+      "UnitState", "TransportDependent", "Local", FALSE
     }
 
 [actionenabler_join_city]

Modified: trunk/data/civ2civ3/game.ruleset
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/civ2civ3/game.ruleset?rev=28687&r1=28686&r2=28687&view=diff
==============================================================================
--- trunk/data/civ2civ3/game.ruleset    (original)
+++ trunk/data/civ2civ3/game.ruleset    Wed Apr  1 23:46:51 2015
@@ -429,6 +429,7 @@
 actor_reqs    =
     { "type",   "name", "range", "present"
       "Unitflag", "Cities", "Local", TRUE
+      "UnitState", "TransportDependent", "Local", FALSE
     }
 
 [actionenabler_join_city]

Modified: trunk/data/classic/game.ruleset
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/classic/game.ruleset?rev=28687&r1=28686&r2=28687&view=diff
==============================================================================
--- trunk/data/classic/game.ruleset     (original)
+++ trunk/data/classic/game.ruleset     Wed Apr  1 23:46:51 2015
@@ -401,6 +401,7 @@
 actor_reqs    =
     { "type",   "name", "range", "present"
       "Unitflag", "Cities", "Local", TRUE
+      "UnitState", "TransportDependent", "Local", FALSE
     }
 
 [actionenabler_join_city]

Modified: trunk/data/experimental/game.ruleset
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/experimental/game.ruleset?rev=28687&r1=28686&r2=28687&view=diff
==============================================================================
--- trunk/data/experimental/game.ruleset        (original)
+++ trunk/data/experimental/game.ruleset        Wed Apr  1 23:46:51 2015
@@ -420,6 +420,7 @@
 actor_reqs    =
     { "type",   "name", "range", "present"
       "Unitflag", "Cities", "Local", TRUE
+      "UnitState", "TransportDependent", "Local", FALSE
     }
 
 [actionenabler_join_city]

Modified: trunk/data/multiplayer/game.ruleset
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/multiplayer/game.ruleset?rev=28687&r1=28686&r2=28687&view=diff
==============================================================================
--- trunk/data/multiplayer/game.ruleset (original)
+++ trunk/data/multiplayer/game.ruleset Wed Apr  1 23:46:51 2015
@@ -385,6 +385,7 @@
 actor_reqs    =
     { "type",   "name", "range", "present"
       "Unitflag", "Cities", "Local", TRUE
+      "UnitState", "TransportDependent", "Local", FALSE
     }
 
 [actionenabler_join_city]

Modified: trunk/doc/README.actions
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/doc/README.actions?rev=28687&r1=28686&r2=28687&view=diff
==============================================================================
--- trunk/doc/README.actions    (original)
+++ trunk/doc/README.actions    Wed Apr  1 23:46:51 2015
@@ -241,7 +241,6 @@
  * the scenario setting prevent_new_cities must be false.
  * actor must be on the same tile as the target.
  * actor must have movement left.
- * actor must not be transport dependent.
  * target must not have the NoCities terrain flag.
  * target must not be owned by a foreign player.
  * target must not be closer than citymindist to nearest city.

Modified: trunk/fc_version
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/fc_version?rev=28687&r1=28686&r2=28687&view=diff
==============================================================================
--- trunk/fc_version    (original)
+++ trunk/fc_version    Wed Apr  1 23:46:51 2015
@@ -54,7 +54,7 @@
 #   - Avoid adding a new mandatory capability to the development branch for
 #     as long as possible.  We want to maintain network compatibility with
 #     the stable branch for as long as possible.
-NETWORK_CAPSTRING_MANDATORY="+Freeciv.Devel-3.0-2015.Apr.01"
+NETWORK_CAPSTRING_MANDATORY="+Freeciv.Devel-3.0-2015.Apr.01b"
 NETWORK_CAPSTRING_OPTIONAL=""
 
 FREECIV_DISTRIBUTOR=""

Modified: trunk/server/rscompat.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/rscompat.c?rev=28687&r1=28686&r2=28687&view=diff
==============================================================================
--- trunk/server/rscompat.c     (original)
+++ trunk/server/rscompat.c     Wed Apr  1 23:46:51 2015
@@ -245,6 +245,11 @@
                               req_from_str("UnitFlag", "Local", FALSE,
                                            TRUE, "Cities"));
 
+    /* The actor must be on native terrain. */
+    requirement_vector_append(&enabler->actor_reqs,
+                              req_from_str("UnitState", "Local", FALSE,
+                                           FALSE, "TransportDependent"));
+
     action_enabler_add(enabler);
 
     /* City joining is now action enabler controlled. Add the old rule


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to