mirror of https://github.com/OpenTTD/OpenTTD
Add: [NewGRF] Station variable 6A, querying GRFID of nearby station tiles (#7956)
parent
2fee030a26
commit
5df01bf95e
|
@ -368,6 +368,16 @@ TownScopeResolver *StationResolverObject::GetTown()
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case 0x6A: { // GRFID of nearby station tiles
|
||||||
|
TileIndex nearby_tile = GetNearbyTile(parameter, this->tile);
|
||||||
|
|
||||||
|
if (!HasStationTileRail(nearby_tile)) return 0xFFFFFFFF;
|
||||||
|
if (!IsCustomStationSpecIndex(nearby_tile)) return 0;
|
||||||
|
|
||||||
|
const StationSpecList ssl = BaseStation::GetByTile(nearby_tile)->speclist[GetCustomStationSpecIndex(nearby_tile)];
|
||||||
|
return ssl.grfid;
|
||||||
|
}
|
||||||
|
|
||||||
/* General station variables */
|
/* General station variables */
|
||||||
case 0x82: return 50;
|
case 0x82: return 50;
|
||||||
case 0x84: return this->st->string_id;
|
case 0x84: return this->st->string_id;
|
||||||
|
|
|
@ -127,6 +127,7 @@ static const NIVariable _niv_stations[] = {
|
||||||
NIV(0x67, "land info of nearby tiles"),
|
NIV(0x67, "land info of nearby tiles"),
|
||||||
NIV(0x68, "station info of nearby tiles"),
|
NIV(0x68, "station info of nearby tiles"),
|
||||||
NIV(0x69, "information about cargo accepted in the past"),
|
NIV(0x69, "information about cargo accepted in the past"),
|
||||||
|
NIV(0x6A, "GRFID of nearby station tiles"),
|
||||||
NIV_END()
|
NIV_END()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue