diff -r e018c792e9b9 -r b2871568db92 src/newgrf_commons.cpp --- a/src/newgrf_commons.cpp Fri Jun 08 16:53:21 2007 +0000 +++ b/src/newgrf_commons.cpp Fri Jun 08 17:54:18 2007 +0000 @@ -165,3 +165,13 @@ } } +TileIndex GetNearbyTile(byte parameter, TileIndex tile) +{ + int8 x = GB(parameter, 0, 4); + int8 y = GB(parameter, 4, 4); + + if (x >= 8) x -= 16; + if (y >= 8) y -= 16; + + return tile + TileDiffXY(x, y); +}