Add: Station variable 6B to get extended station id of nearby tiles (#10953)
This commit is contained in:
@@ -376,6 +376,22 @@ TownScopeResolver *StationResolverObject::GetTown()
|
||||
return ssl.grfid;
|
||||
}
|
||||
|
||||
case 0x6B: { // 16 bit Station ID of nearby tiles
|
||||
TileIndex nearby_tile = GetNearbyTile(parameter, this->tile);
|
||||
|
||||
if (!HasStationTileRail(nearby_tile)) return 0xFFFFFFFF;
|
||||
if (!IsCustomStationSpecIndex(nearby_tile)) return 0xFFFE;
|
||||
|
||||
uint32_t grfid = this->st->speclist[GetCustomStationSpecIndex(this->tile)].grfid;
|
||||
|
||||
const StationSpecList ssl = BaseStation::GetByTile(nearby_tile)->speclist[GetCustomStationSpecIndex(nearby_tile)];
|
||||
if (ssl.grfid == grfid) {
|
||||
return ssl.localidx;
|
||||
}
|
||||
|
||||
return 0xFFFE;
|
||||
}
|
||||
|
||||
/* General station variables */
|
||||
case 0x82: return 50;
|
||||
case 0x84: return this->st->string_id;
|
||||
|
Reference in New Issue
Block a user