summaryrefslogtreecommitdiff
path: root/src/newgrf_commons.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/newgrf_commons.cpp')
-rw-r--r--src/newgrf_commons.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/newgrf_commons.cpp b/src/newgrf_commons.cpp
index 6521a39f7..4bf5b6e9f 100644
--- a/src/newgrf_commons.cpp
+++ b/src/newgrf_commons.cpp
@@ -395,13 +395,13 @@ uint32 GetTerrainType(TileIndex tile, TileContext context)
}
}
-TileIndex GetNearbyTile(byte parameter, TileIndex tile)
+TileIndex GetNearbyTile(byte parameter, TileIndex tile, bool signed_offsets)
{
int8 x = GB(parameter, 0, 4);
int8 y = GB(parameter, 4, 4);
- if (x >= 8) x -= 16;
- if (y >= 8) y -= 16;
+ if (signed_offsets && x >= 8) x -= 16;
+ if (signed_offsets && y >= 8) y -= 16;
/* Swap width and height depending on axis for railway stations */
if (HasStationTileRail(tile) && GetRailStationAxis(tile) == AXIS_Y) Swap(x, y);