Author: sveinung
Date: Fri Aug 12 20:38:14 2016
New Revision: 33583

URL: http://svn.gna.org/viewcvs/freeciv?rev=33583&view=rev
Log:
Delete unused act vs own tile functions.

"Do..." can now act against any target tile the user selects, not only the
tile the actor is located at. It is therefore enabled for any actor unit.
This makes the functions can_units_act_against_own_tile() and
can_unit_act_against_own_tile() redundant. Remove them.

See patch #7593

Modified:
    trunk/client/climisc.c
    trunk/client/climisc.h

Modified: trunk/client/climisc.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/climisc.c?rev=33583&r1=33582&r2=33583&view=diff
==============================================================================
--- trunk/client/climisc.c      (original)
+++ trunk/client/climisc.c      Fri Aug 12 20:38:14 2016
@@ -1210,47 +1210,6 @@
 }
 
 /**************************************************************************
-  Returns TRUE if the unit can do a generalized action against its own
-  tile. May contain false positives.
-**************************************************************************/
-bool can_unit_act_against_own_tile(struct unit *act_unit)
-{
-  if (!utype_may_act_at_all(unit_type_get(act_unit))) {
-    /* Not an actor unit. */
-    return FALSE;
-  }
-
-  action_iterate(act) {
-    if (action_maybe_possible_actor_unit(act, act_unit)) {
-      /* May be able to act. */
-      return TRUE;
-    }
-  } action_iterate_end;
-
-  /* No action against any kind of target possible. */
-  return FALSE;
-}
-
-/**************************************************************************
-  Returns TRUE if any of the units in the provided list can do a
-  generalized action against a target at its own tile.
-**************************************************************************/
-bool can_units_act_against_own_tile(struct unit_list *punits)
-{
-  unit_list_iterate(punits, punit) {
-    /* Can't return unless TRUE. Another unit may be able to act against a
-     * target at its won tile. */
-    if (can_unit_act_against_own_tile(punit)) {
-      return TRUE;
-    }
-  } unit_list_iterate_end;
-
-  /* No unit in the list were able to act against a target located at its
-   * own tile. */
-  return FALSE;
-}
-
-/**************************************************************************
   Initialize the action probability cache. Shouldn't be kept around
   permanently. Its data is quickly outdated.
 **************************************************************************/

Modified: trunk/client/climisc.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/climisc.h?rev=33583&r1=33582&r2=33583&view=diff
==============================================================================
--- trunk/client/climisc.h      (original)
+++ trunk/client/climisc.h      Fri Aug 12 20:38:14 2016
@@ -120,9 +120,6 @@
                           enum unit_activity activity,
                           struct extra_type *tgt);
 
-bool can_unit_act_against_own_tile(struct unit *punit);
-bool can_units_act_against_own_tile(struct unit_list *punits);
-
 void client_unit_init_act_prob_cache(struct unit *punit);
 
 enum unit_bg_color_type { UNIT_BG_HP_LOSS,


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

Reply via email to