(svn r10066) -Codechange: Expose function GetNearbyTile by moving it to newgrf_commons.[cpp|h]. Will be used by industries in a few.

This commit is contained in:
belugas
2007-06-08 17:54:18 +00:00
parent 6983d0b547
commit e8c6d57150
3 changed files with 22 additions and 14 deletions

View File

@@ -165,3 +165,13 @@ uint32 GetTerrainType(TileIndex tile)
}
}
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);
}