Author: sveinung
Date: Tue Mar  8 15:27:28 2016
New Revision: 32203

URL: http://svn.gna.org/viewcvs/freeciv?rev=32203&view=rev
Log:
Evaluate actor_reqs against actor's tile city.

Make City range action enabler actor requirements about the city the actor
unit is located inside. The alternative is to make it about the actor unit's
home city.

This allows action enablers to depend on city walls, oil depots, airports
and turrets. The cost is that they won't be able to depend on smuggler's
dens, special secret munition factories and public schools.

Picking the tile city is consistent with depending on the actor unit's
current tile. Home city properties can be supported later via other
mechanisms.

See patch #7039

Modified:
    branches/S2_6/common/actions.c
    branches/S2_6/fc_version

Modified: branches/S2_6/common/actions.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/common/actions.c?rev=32203&r1=32202&r2=32203&view=diff
==============================================================================
--- branches/S2_6/common/actions.c      (original)
+++ branches/S2_6/common/actions.c      Tue Mar  8 15:27:28 2016
@@ -714,6 +714,8 @@
                                     const struct unit *actor_unit,
                                     const struct city *target_city)
 {
+  struct tile *actor_tile = unit_tile(actor_unit);
+
   if (actor_unit == NULL || target_city == NULL) {
     /* Can't do an action when actor or target are missing. */
     return FALSE;
@@ -734,8 +736,8 @@
                         action_target_kind_name(ATK_CITY));
 
   return is_action_enabled(wanted_action,
-                           unit_owner(actor_unit), NULL, NULL,
-                           unit_tile(actor_unit),
+                           unit_owner(actor_unit), tile_city(actor_tile),
+                           NULL, actor_tile,
                            actor_unit, unit_type_get(actor_unit),
                            NULL, NULL,
                            city_owner(target_city), target_city, NULL,
@@ -753,6 +755,8 @@
                                     const struct unit *actor_unit,
                                     const struct unit *target_unit)
 {
+  struct tile *actor_tile = unit_tile(actor_unit);
+
   if (actor_unit == NULL || target_unit == NULL) {
     /* Can't do an action when actor or target are missing. */
     return FALSE;
@@ -773,8 +777,8 @@
                         action_target_kind_name(ATK_UNIT));
 
   return is_action_enabled(wanted_action,
-                           unit_owner(actor_unit), NULL, NULL,
-                           unit_tile(actor_unit),
+                           unit_owner(actor_unit), tile_city(actor_tile),
+                           NULL, actor_tile,
                            actor_unit, unit_type_get(actor_unit),
                            NULL, NULL,
                            unit_owner(target_unit),
@@ -1173,6 +1177,8 @@
                                        const int action_id,
                                        const struct city* target_city)
 {
+  struct tile *actor_tile = unit_tile(actor_unit);
+
   if (actor_unit == NULL || target_city == NULL) {
     /* Can't do an action when actor or target are missing. */
     return ACTPROB_IMPOSSIBLE;
@@ -1193,8 +1199,8 @@
                         action_target_kind_name(ATK_CITY));
 
   return action_prob(action_id,
-                     unit_owner(actor_unit), NULL, NULL,
-                     unit_tile(actor_unit), actor_unit,
+                     unit_owner(actor_unit), tile_city(actor_tile),
+                     NULL, actor_tile, actor_unit,
                      NULL, NULL,
                      city_owner(target_city), target_city, NULL,
                      city_tile(target_city), NULL, NULL, NULL);
@@ -1208,6 +1214,8 @@
                                        const int action_id,
                                        const struct unit* target_unit)
 {
+  struct tile *actor_tile = unit_tile(actor_unit);
+
   if (actor_unit == NULL || target_unit == NULL) {
     /* Can't do an action when actor or target are missing. */
     return ACTPROB_IMPOSSIBLE;
@@ -1228,8 +1236,8 @@
                         action_target_kind_name(ATK_UNIT));
 
   return action_prob(action_id,
-                     unit_owner(actor_unit), NULL, NULL,
-                     unit_tile(actor_unit), actor_unit,
+                     unit_owner(actor_unit), tile_city(actor_tile),
+                     NULL, actor_tile, actor_unit,
                      NULL, NULL,
                      unit_owner(target_unit),
                      tile_city(unit_tile(target_unit)), NULL,

Modified: branches/S2_6/fc_version
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/fc_version?rev=32203&r1=32202&r2=32203&view=diff
==============================================================================
--- branches/S2_6/fc_version    (original)
+++ branches/S2_6/fc_version    Tue Mar  8 15:27:28 2016
@@ -55,7 +55,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-2.6-2016.Mar.02"
+NETWORK_CAPSTRING_MANDATORY="+Freeciv.Devel-2.6-2016.Mar.08"
 NETWORK_CAPSTRING_OPTIONAL=""
 
 FREECIV_DISTRIBUTOR=""


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

Reply via email to