Author: cazfi
Date: Tue Sep  8 20:09:16 2015
New Revision: 29821

URL: http://svn.gna.org/viewcvs/freeciv?rev=29821&view=rev
Log:
Replaced road_type_iterate() with extra_type_by_cause_iterate(EC_ROAD) in 
threaded AI.

See patch #6328

Modified:
    branches/S2_6/ai/threaded/taicity.c

Modified: branches/S2_6/ai/threaded/taicity.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/ai/threaded/taicity.c?rev=29821&r1=29820&r2=29821&view=diff
==============================================================================
--- branches/S2_6/ai/threaded/taicity.c (original)
+++ branches/S2_6/ai/threaded/taicity.c Tue Sep  8 20:09:16 2015
@@ -234,14 +234,16 @@
          * removal activity it's the value after the removal. */
         old_move_cost = tile_terrain(ptile)->movement_cost * SINGLE_MOVE;
 
-        road_type_iterate(pold) {
-          if (tile_has_road(ptile, pold) && pold != proad) {
+        extra_type_by_cause_iterate(EC_ROAD, poe) {
+          struct road_type *pold = extra_road_get(poe);
+
+          if (tile_has_extra(ptile, poe) && poe != tgt) {
             if (road_provides_move_bonus(pold)
                 && pold->move_cost < old_move_cost) {
               old_move_cost = pold->move_cost;
             }
           }
-        } road_type_iterate_end;
+        } extra_type_by_cause_iterate_end;
 
         if (proad->move_cost < old_move_cost) {
           if (proad->move_cost >= terrain_control.move_fragments) {


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

Reply via email to