Author: sveinung
Date: Sat Dec 20 20:20:59 2014
New Revision: 27364

URL: http://svn.gna.org/viewcvs/freeciv?rev=27364&view=rev
Log:
Let units without the HelpWonder flag help build wonders.

Move the rule that a unit must have the HelpWonder flag to help build a
wonder to the ruleset.

The HelpWonder unit type flag can't become ruleset defined yet since it
still is hard coded in some AI and client code.

See patch #5583

Modified:
    trunk/common/actions.c
    trunk/common/unit.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

Modified: trunk/common/actions.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/actions.c?rev=27364&r1=27363&r2=27364&view=diff
==============================================================================
--- trunk/common/actions.c      (original)
+++ trunk/common/actions.c      Sat Dec 20 20:20:59 2014
@@ -383,15 +383,6 @@
                               req_from_str("DiplRel", "Local", FALSE,
                                            TRUE, "Is foreign"));
   }
-
-  if (enabler->action == ACTION_HELP_WONDER) {
-    /* There are still places that assumes that units that can help build a
-     * wonder have the HelpWonder flag. */
-    /* TODO: Move this restriction to the ruleset. */
-    requirement_vector_append(&enabler->actor_reqs,
-                              req_from_str("Unitflag", "Local", FALSE,
-                                           TRUE, "HelpWonder"));
-  }
 }
 
 /**************************************************************************

Modified: trunk/common/unit.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/unit.c?rev=27364&r1=27363&r2=27364&view=diff
==============================================================================
--- trunk/common/unit.c (original)
+++ trunk/common/unit.c Sat Dec 20 20:20:59 2014
@@ -202,7 +202,7 @@
     return FALSE;
   }
 
-  return (unit_has_type_flag(punit, UTYF_HELP_WONDER)
+  return (utype_can_do_action(unit_type(punit), ACTION_HELP_WONDER)
          && VUT_IMPROVEMENT == pcity->production.kind
          && is_wonder(pcity->production.value.building)
          && (pcity->shield_stock

Modified: trunk/data/alien/game.ruleset
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/alien/game.ruleset?rev=27364&r1=27363&r2=27364&view=diff
==============================================================================
--- trunk/data/alien/game.ruleset       (original)
+++ trunk/data/alien/game.ruleset       Sat Dec 20 20:20:59 2014
@@ -279,6 +279,7 @@
 action = "Help Wonder"
 actor_reqs    =
     { "type",   "name", "range", "present"
+      "Unitflag", "HelpWonder", "Local", TRUE
       "DiplRel", "Is foreign", "Local", FALSE
     }
 

Modified: trunk/data/civ1/game.ruleset
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/civ1/game.ruleset?rev=27364&r1=27363&r2=27364&view=diff
==============================================================================
--- trunk/data/civ1/game.ruleset        (original)
+++ trunk/data/civ1/game.ruleset        Sat Dec 20 20:20:59 2014
@@ -264,6 +264,7 @@
 action = "Help Wonder"
 actor_reqs    =
     { "type",   "name", "range", "present"
+      "Unitflag", "HelpWonder", "Local", TRUE
       "DiplRel", "Is foreign", "Local", FALSE
     }
 

Modified: trunk/data/civ2/game.ruleset
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/civ2/game.ruleset?rev=27364&r1=27363&r2=27364&view=diff
==============================================================================
--- trunk/data/civ2/game.ruleset        (original)
+++ trunk/data/civ2/game.ruleset        Sat Dec 20 20:20:59 2014
@@ -309,6 +309,7 @@
 action = "Help Wonder"
 actor_reqs    =
     { "type",   "name", "range", "present"
+      "Unitflag", "HelpWonder", "Local", TRUE
       "DiplRel", "Is foreign", "Local", FALSE
     }
 

Modified: trunk/data/civ2civ3/game.ruleset
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/civ2civ3/game.ruleset?rev=27364&r1=27363&r2=27364&view=diff
==============================================================================
--- trunk/data/civ2civ3/game.ruleset    (original)
+++ trunk/data/civ2civ3/game.ruleset    Sat Dec 20 20:20:59 2014
@@ -352,6 +352,7 @@
 action = "Help Wonder"
 actor_reqs    =
     { "type",   "name", "range", "present"
+      "Unitflag", "HelpWonder", "Local", TRUE
       "DiplRel", "Is foreign", "Local", FALSE
     }
 

Modified: trunk/data/classic/game.ruleset
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/classic/game.ruleset?rev=27364&r1=27363&r2=27364&view=diff
==============================================================================
--- trunk/data/classic/game.ruleset     (original)
+++ trunk/data/classic/game.ruleset     Sat Dec 20 20:20:59 2014
@@ -341,6 +341,7 @@
 action = "Help Wonder"
 actor_reqs    =
     { "type",   "name", "range", "present"
+      "Unitflag", "HelpWonder", "Local", TRUE
       "DiplRel", "Is foreign", "Local", FALSE
     }
 

Modified: trunk/data/experimental/game.ruleset
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/experimental/game.ruleset?rev=27364&r1=27363&r2=27364&view=diff
==============================================================================
--- trunk/data/experimental/game.ruleset        (original)
+++ trunk/data/experimental/game.ruleset        Sat Dec 20 20:20:59 2014
@@ -360,6 +360,7 @@
 action = "Help Wonder"
 actor_reqs    =
     { "type",   "name", "range", "present"
+      "Unitflag", "HelpWonder", "Local", TRUE
       "DiplRel", "Is foreign", "Local", FALSE
     }
 

Modified: trunk/data/multiplayer/game.ruleset
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/multiplayer/game.ruleset?rev=27364&r1=27363&r2=27364&view=diff
==============================================================================
--- trunk/data/multiplayer/game.ruleset (original)
+++ trunk/data/multiplayer/game.ruleset Sat Dec 20 20:20:59 2014
@@ -331,6 +331,7 @@
 action = "Help Wonder"
 actor_reqs    =
     { "type",   "name", "range", "present"
+      "Unitflag", "HelpWonder", "Local", TRUE
       "DiplRel", "Is foreign", "Local", FALSE
     }
 

Modified: trunk/doc/README.actions
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/doc/README.actions?rev=27364&r1=27363&r2=27364&view=diff
==============================================================================
--- trunk/doc/README.actions    (original)
+++ trunk/doc/README.actions    Sat Dec 20 20:20:59 2014
@@ -187,7 +187,6 @@
  * trade route type (see Trade settings) can't be 0%.
 
 "Help Wonder" - Add the shields used to build the actor to the target city.
- * actor must have the "HelpWonder" unit flag.
  * actor must be on the same tile as the target or on the tile next to it.
  * target must be building a wonder.
  * target city must still need the extra sheilds to build the wonder.


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

Reply via email to