Author: cazfi
Date: Thu Feb 18 04:07:14 2016
New Revision: 31970

URL: http://svn.gna.org/viewcvs/freeciv?rev=31970&view=rev
Log:
While calculating move costs, RMM_RELAXED diagonal move between integrating 
roads is now always considered possible
to the other directions if it's possible to one direction. Previously it 
depended on which one of the roads was
on the tile to go through.

See bug #24395

Modified:
    trunk/common/map.c
    trunk/common/movement.c

Modified: trunk/common/map.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/map.c?rev=31970&r1=31969&r2=31970&view=diff
==============================================================================
--- trunk/common/map.c  (original)
+++ trunk/common/map.c  Thu Feb 18 04:07:14 2016
@@ -778,7 +778,10 @@
             case RMM_RELAXED:
               if (cost > proad->move_cost * 2) {
                 cardinal_between_iterate(t1, t2, between) {
-                  if (tile_has_extra(between, pextra)) {
+                  if (tile_has_extra(between, pextra)
+                      || (pextra != iextra && tile_has_extra(between, 
iextra))) {
+                    /* 'pextra != iextra' is there just to avoid 
tile_has_extra()
+                     * in by far more common case that 'pextra == iextra' */
                     /* TODO: Should we restrict this more?
                      * Should we check against enemy cities on between tile?
                      * Should we check against non-native terrain on between 
tile?

Modified: trunk/common/movement.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/movement.c?rev=31970&r1=31969&r2=31970&view=diff
==============================================================================
--- trunk/common/movement.c     (original)
+++ trunk/common/movement.c     Thu Feb 18 04:07:14 2016
@@ -391,8 +391,10 @@
         }
         cardinal_between_iterate(src_tile, dst_tile, between) {
           if (tile_has_extra(between, iextra)
-              || tile_has_extra(between, pextra)) {
-            /* We have a link for the connection. */
+              || (pextra != iextra && tile_has_extra(between, pextra))) {
+            /* We have a link for the connection.
+             * 'pextra != iextra' is there just to avoid tile_has_extra()
+             * in by far more common case that 'pextra == iextra' */
             return TRUE;
           }
         } cardinal_between_iterate_end;


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

Reply via email to