Author: sveinung
Date: Fri Dec 12 14:08:50 2014
New Revision: 27266

URL: http://svn.gna.org/viewcvs/freeciv?rev=27266&view=rev
Log:
Remove redundant is_actor_unit() calls.

Checking if a unit type can perform any action at all AND that it can perform
any hostile actions is redundant. If it can perform hostile actions it can
perform at least one action.

See patch #5531

Modified:
    trunk/ai/default/aitools.c
    trunk/client/goto.c

Modified: trunk/ai/default/aitools.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/ai/default/aitools.c?rev=27266&r1=27265&r2=27266&view=diff
==============================================================================
--- trunk/ai/default/aitools.c  (original)
+++ trunk/ai/default/aitools.c  Fri Dec 12 14:08:50 2014
@@ -560,8 +560,7 @@
     parameter->get_zoc = NULL;
   }
 
-  if (is_actor_unit(punit)
-      && utype_acts_hostile(unit_type(punit))) {
+  if (utype_acts_hostile(unit_type(punit))) {
     /* Default tile behaviour */
   } else if (unit_has_type_flag(punit, UTYF_SETTLERS)) {
     parameter->get_TB = no_fights;

Modified: trunk/client/goto.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/goto.c?rev=27266&r1=27265&r2=27266&view=diff
==============================================================================
--- trunk/client/goto.c (original)
+++ trunk/client/goto.c Fri Dec 12 14:08:50 2014
@@ -796,8 +796,7 @@
 
   parameter->get_EC = get_EC;
   if (is_attack_unit(punit)
-      || (is_actor_unit(punit)
-          && utype_acts_hostile(unit_type(punit)))) {
+      || utype_acts_hostile(unit_type(punit))) {
     parameter->get_TB = get_TB_aggr;
   } else if (is_actor_unit(punit)
              && !utype_acts_hostile(unit_type(punit))) {


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

Reply via email to