NewGRF: Only extend value of road stops variable 68 if feature tested for

This commit is contained in:
Jonathan G Rennison
2023-06-01 18:14:23 +01:00
parent 5989edab8d
commit 1dbbbed9e5
8 changed files with 41 additions and 11 deletions

View File

@@ -5973,6 +5973,11 @@ static void NewSpriteGroup(ByteReader *buf)
}
}
if (info.scope_feature == GSF_ROADSTOPS && HasBit(_cur.grffile->observed_feature_tests, GFTOF_ROAD_STOPS)) {
if (adjust.variable == 0x68) adjust.variable = A2VRI_ROADSTOP_INFO_NEARBY_TILES_EXT;
if (adjust.variable == 0x7B && adjust.parameter == 0x68) adjust.parameter = A2VRI_ROADSTOP_INFO_NEARBY_TILES_EXT;
}
if (adjust.type != DSGA_TYPE_NONE) {
adjust.add_val = buf->ReadVarSize(varsize);
adjust.divmod_val = buf->ReadVarSize(varsize);