Add: Station variable 6B to get extended station id of nearby tiles (#10953)
(cherry picked from commit 8d62a8f0f0
)
This commit is contained in:

committed by
Jonathan G Rennison

parent
728971ddbc
commit
16574946da
@@ -219,6 +219,23 @@ uint32_t RoadStopScopeResolver::GetVariable(uint16_t variable, uint32_t paramete
|
||||
return ssl.grfid;
|
||||
}
|
||||
|
||||
/* 16 bit road stop ID of nearby tiles */
|
||||
case 0x6B: {
|
||||
TileIndex nearby_tile = GetNearbyTile(parameter, this->tile);
|
||||
|
||||
if (!IsAnyRoadStopTile(nearby_tile)) return 0xFFFFFFFF;
|
||||
if (!IsCustomRoadStopSpecIndex(nearby_tile)) return 0xFFFE;
|
||||
|
||||
uint32_t grfid = this->st->roadstop_speclist[GetCustomRoadStopSpecIndex(this->tile)].grfid;
|
||||
|
||||
const RoadStopSpecList ssl = BaseStation::GetByTile(nearby_tile)->roadstop_speclist[GetCustomRoadStopSpecIndex(nearby_tile)];
|
||||
if (ssl.grfid == grfid) {
|
||||
return ssl.localidx;
|
||||
}
|
||||
|
||||
return 0xFFFE;
|
||||
}
|
||||
|
||||
/* Road info of nearby tiles */
|
||||
case A2VRI_ROADSTOP_ROAD_INFO_NEARBY_TILES: {
|
||||
if (this->tile == INVALID_TILE) return 0xFFFFFFFF;
|
||||
|
Reference in New Issue
Block a user