summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--npf.c4
-rw-r--r--yapf/yapf_road.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/npf.c b/npf.c
index f3cf1f1fc..b0f1b48df 100644
--- a/npf.c
+++ b/npf.c
@@ -190,12 +190,12 @@ static uint NPFSlopeCost(AyStarNode* current)
x = TileX(current->tile) * TILE_SIZE;
y = TileY(current->tile) * TILE_SIZE;
/* get the height of the center of the current tile */
- z1 = GetSlopeZ(x+TILE_HEIGHT, y+TILE_HEIGHT);
+ z1 = GetSlopeZ(x + TILE_SIZE / 2, y + TILE_SIZE / 2);
x = TileX(next) * TILE_SIZE;
y = TileY(next) * TILE_SIZE;
/* get the height of the center of the next tile */
- z2 = GetSlopeZ(x+TILE_HEIGHT, y+TILE_HEIGHT);
+ z2 = GetSlopeZ(x + TILE_SIZE / 2, y + TILE_SIZE / 2);
if (z2 - z1 > 1) {
/* Slope up */
diff --git a/yapf/yapf_road.cpp b/yapf/yapf_road.cpp
index 1f54e5799..086c30332 100644
--- a/yapf/yapf_road.cpp
+++ b/yapf/yapf_road.cpp
@@ -24,12 +24,12 @@ protected:
// height of the center of the current tile
int x1 = TileX(tile) * TILE_SIZE;
int y1 = TileY(tile) * TILE_SIZE;
- int z1 = GetSlopeZ(x1 + TILE_HEIGHT, y1 + TILE_HEIGHT);
+ int z1 = GetSlopeZ(x1 + TILE_SIZE / 2, y1 + TILE_SIZE / 2);
// height of the center of the next tile
int x2 = TileX(next_tile) * TILE_SIZE;
int y2 = TileY(next_tile) * TILE_SIZE;
- int z2 = GetSlopeZ(x2 + TILE_HEIGHT, y2 + TILE_HEIGHT);
+ int z2 = GetSlopeZ(x2 + TILE_SIZE / 2, y2 + TILE_SIZE / 2);
if (z2 - z1 > 1) {
/* Slope up */