diff options
author | yexo <yexo@openttd.org> | 2010-10-19 21:00:45 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2010-10-19 21:00:45 +0000 |
commit | 9373ee71d999a08c51938f6214fc0360c477992a (patch) | |
tree | 00e8ee0c86f194913c08f2bb0876a1ae08b00537 /src/newgrf_commons.cpp | |
parent | 3ab422b05715591be52334ce8cd522e506ddfdee (diff) | |
download | openttd-9373ee71d999a08c51938f6214fc0360c477992a.tar.xz |
(svn r20996) -Change: [NewGRF] the X and Y offsets in the parameter for industry vars 60,61,62,63 are unsigned instead of signed
Diffstat (limited to 'src/newgrf_commons.cpp')
-rw-r--r-- | src/newgrf_commons.cpp | 6 |
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); |