Author: cazfi Date: Thu Feb 18 04:07:22 2016 New Revision: 31971 URL: http://svn.gna.org/viewcvs/freeciv?rev=31971&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: branches/S2_6/common/map.c branches/S2_6/common/movement.c Modified: branches/S2_6/common/map.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/common/map.c?rev=31971&r1=31970&r2=31971&view=diff ============================================================================== --- branches/S2_6/common/map.c (original) +++ branches/S2_6/common/map.c Thu Feb 18 04:07:22 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: branches/S2_6/common/movement.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/common/movement.c?rev=31971&r1=31970&r2=31971&view=diff ============================================================================== --- branches/S2_6/common/movement.c (original) +++ branches/S2_6/common/movement.c Thu Feb 18 04:07:22 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