From: <mp...@us...> - 2013-01-20 00:13:22
|
Revision: 10478 http://sourceforge.net/p/freecol/code/10478 Author: mpope Date: 2013-01-20 00:13:19 +0000 (Sun, 20 Jan 2013) Log Message: ----------- Merge git.330b25f Scout default cost decider avoids enemies, BR#2376. Modified Paths: -------------- freecol/trunk/src/net/sf/freecol/common/model/pathfinding/CostDeciders.java Modified: freecol/trunk/src/net/sf/freecol/common/model/pathfinding/CostDeciders.java =================================================================== --- freecol/trunk/src/net/sf/freecol/common/model/pathfinding/CostDeciders.java 2013-01-20 00:05:44 UTC (rev 10477) +++ freecol/trunk/src/net/sf/freecol/common/model/pathfinding/CostDeciders.java 2013-01-20 00:13:19 UTC (rev 10478) @@ -22,8 +22,8 @@ import net.sf.freecol.common.model.Europe; import net.sf.freecol.common.model.Location; import net.sf.freecol.common.model.Map; +import net.sf.freecol.common.model.Settlement; import net.sf.freecol.common.model.Tile; -import net.sf.freecol.common.model.Settlement; import net.sf.freecol.common.model.Unit; @@ -176,9 +176,10 @@ * @return A suitable <code>CostDecider</code>. */ public static CostDecider defaultCostDeciderFor(final Unit unit) { - return (unit == null || !unit.isOffensiveUnit()) - ? avoidSettlementsAndBlockingUnits() - : avoidSettlements(); + return (unit != null && unit.isOffensiveUnit() + && unit.getRole() != Unit.Role.SCOUT) + ? avoidSettlements() + : avoidSettlementsAndBlockingUnits(); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |