GRF: Use access mask when evaluating get nearby tile information variable
This commit is contained in:
@@ -31,12 +31,14 @@
|
||||
* @param grf_version8 True, if we are dealing with a new NewGRF which uses GRF version >= 8.
|
||||
* @return a construction of bits obeying the newgrf format
|
||||
*/
|
||||
uint32 GetNearbyIndustryTileInformation(byte parameter, TileIndex tile, IndustryID index, bool signed_offsets, bool grf_version8)
|
||||
uint32 GetNearbyIndustryTileInformation(byte parameter, TileIndex tile, IndustryID index, bool signed_offsets, bool grf_version8, uint32 mask)
|
||||
{
|
||||
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, grf_version8) | (is_same_industry ? 1 : 0) << 8;
|
||||
uint32 result = (is_same_industry ? 1 : 0) << 8;
|
||||
if (mask & ~0x100) result |= GetNearbyTileInformation(tile, grf_version8, mask);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -78,7 +80,7 @@ uint32 GetRelativePosition(TileIndex tile, TileIndex ind_tile)
|
||||
|
||||
/* Land info of nearby tiles */
|
||||
case 0x60: return GetNearbyIndustryTileInformation(parameter, this->tile,
|
||||
this->industry == nullptr ? (IndustryID)INVALID_INDUSTRY : this->industry->index, true, this->ro.grffile->grf_version >= 8);
|
||||
this->industry == nullptr ? (IndustryID)INVALID_INDUSTRY : this->industry->index, true, this->ro.grffile->grf_version >= 8, extra->mask);
|
||||
|
||||
/* Animation stage of nearby tiles */
|
||||
case 0x61: {
|
||||
|
Reference in New Issue
Block a user