MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / FillTileDescRoadStop

Function FillTileDescRoadStop

src/station_cmd.cpp:3578–3614  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3576}
3577
3578static void FillTileDescRoadStop(TileIndex tile, TileDesc &td)
3579{
3580 RoadType road_rt = GetRoadTypeRoad(tile);
3581 RoadType tram_rt = GetRoadTypeTram(tile);
3582 Owner road_owner = INVALID_OWNER;
3583 Owner tram_owner = INVALID_OWNER;
3584 if (road_rt != INVALID_ROADTYPE) {
3585 const RoadTypeInfo *rti = GetRoadTypeInfo(road_rt);
3586 td.roadtype = rti->strings.name;
3587 td.road_speed = rti->max_speed / 2;
3588 road_owner = GetRoadOwner(tile, RTT_ROAD);
3589 }
3590
3591 if (tram_rt != INVALID_ROADTYPE) {
3592 const RoadTypeInfo *rti = GetRoadTypeInfo(tram_rt);
3593 td.tramtype = rti->strings.name;
3594 td.tram_speed = rti->max_speed / 2;
3595 tram_owner = GetRoadOwner(tile, RTT_TRAM);
3596 }
3597
3598 if (IsDriveThroughStopTile(tile)) {
3599 /* Is there a mix of owners? */
3600 if ((tram_owner != INVALID_OWNER && tram_owner != td.owner[0]) ||
3601 (road_owner != INVALID_OWNER && road_owner != td.owner[0])) {
3602 uint i = 1;
3603 if (road_owner != INVALID_OWNER) {
3604 td.owner_type[i] = STR_LAND_AREA_INFORMATION_ROAD_OWNER;
3605 td.owner[i] = road_owner;
3606 i++;
3607 }
3608 if (tram_owner != INVALID_OWNER) {
3609 td.owner_type[i] = STR_LAND_AREA_INFORMATION_TRAM_OWNER;
3610 td.owner[i] = tram_owner;
3611 }
3612 }
3613 }
3614}
3615
3616void FillTileDescRailStation(TileIndex tile, TileDesc &td)
3617{

Callers 1

GetTileDesc_StationFunction · 0.85

Calls 5

GetRoadTypeRoadFunction · 0.85
GetRoadTypeTramFunction · 0.85
GetRoadTypeInfoFunction · 0.85
GetRoadOwnerFunction · 0.85
IsDriveThroughStopTileFunction · 0.85

Tested by

no test coverage detected