(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 cd95f6cbc3
commit 36e3b0ea0c
5 changed files with 12 additions and 11 deletions

View File

@@ -32,11 +32,12 @@
* @param parameter from callback. It's in fact a pair of coordinates
* @param tile TileIndex from which the callback was initiated
* @param index of the industry been queried for
* @param signed_offsets Are the x and y offset encoded in parameter signed?
* @return a construction of bits obeying the newgrf format
*/
uint32 GetNearbyIndustryTileInformation(byte parameter, TileIndex tile, IndustryID index)
uint32 GetNearbyIndustryTileInformation(byte parameter, TileIndex tile, IndustryID index, bool signed_offsets)
{
if (parameter != 0) tile = GetNearbyTile(parameter, tile); // only perform if it is required
if (parameter != 0) tile = GetNearbyTile(parameter, tile, signed_offsets); // only perform if it is required
bool is_same_industry = (IsTileType(tile, MP_INDUSTRY) && GetIndustryIndex(tile) == index);
return GetNearbyTileInformation(tile) | (is_same_industry ? 1 : 0) << 8;