Skip to content

Commit

Permalink
Fix navigation cost when furniture destruction is involved
Browse files Browse the repository at this point in the history
  • Loading branch information
miki151 committed Mar 28, 2019
1 parent 94bc5b7 commit 02d2884
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion position.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -944,7 +944,7 @@ optional<double> Position::getNavigationCost(const MovementType& movement) const
}
if (auto furniture = getFurniture(FurnitureLayer::MIDDLE))
if (auto destroyAction = getBestDestroyAction(movement))
return *furniture->getStrength(*destroyAction) / 10;
return 1.0 + *furniture->getStrength(*destroyAction) / 10;
if (movement.canBuildBridge() && canConstruct(FurnitureType::BRIDGE) &&
!movement.isCompatible(getFurniture(FurnitureLayer::GROUND)->getTribe()))
return 10;
Expand Down

0 comments on commit 02d2884

Please sign in to comment.