src/newgrf_commons.cpp
changeset 7323 b2871568db92
parent 7297 1df77fb920bd
child 7331 0a7f00fed4e6
--- 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);
+}