summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/resources/map/map.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/resources/map/map.cpp b/src/resources/map/map.cpp
index 810791222..adda1bcb7 100644
--- a/src/resources/map/map.cpp
+++ b/src/resources/map/map.cpp
@@ -1009,7 +1009,8 @@ Path Map::findPath(const int startX, const int startY,
forbidden here. */
const int dx1 = std::abs(x - destX);
newTile->Hcost = std::abs(dx1 - dy1) * basicCost +
- std::min(dx1, dy1) * (basicCostF);
+ CAST_S32(static_cast<float>(std::min(dx1, dy1)) *
+ (basicCostF));
// Set the current tile as the parent of the new tile
newTile->parentX = curr.x;