(svn r20996) -Change: [NewGRF] the X and Y offsets in the parameter for industry vars 60,61,62,63 are unsigned instead of signed

This commit is contained in:
yexo
2010-10-19 21:00:45 +00:00
parent 3ab422b057
commit 9373ee71d9
5 changed files with 12 additions and 11 deletions

View File

@@ -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);