MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / UpdateTrackElementsRideType

Method UpdateTrackElementsRideType

src/openrct2/park/ParkFile.cpp:1276–1301  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1274 }
1275
1276 void UpdateTrackElementsRideType()
1277 {
1278 auto& gameState = getGameState();
1279 for (int32_t y = 0; y < gameState.mapSize.y; y++)
1280 {
1281 for (int32_t x = 0; x < gameState.mapSize.x; x++)
1282 {
1283 TileElement* tileElement = MapGetFirstElementAt(TileCoordsXY{ x, y });
1284 if (tileElement == nullptr)
1285 continue;
1286 do
1287 {
1288 if (tileElement->getType() != TileElementType::Track)
1289 continue;
1290
1291 auto* trackElement = tileElement->asTrack();
1292 const auto* ride = GetRide(trackElement->GetRideIndex());
1293 if (ride != nullptr)
1294 {
1295 trackElement->SetRideType(ride->type);
1296 }
1297
1298 } while (!(tileElement++)->isLastForTile());
1299 }
1300 }
1301 }
1302
1303 void ReadWriteBannersChunk(GameState_t& gameState, OrcaStream& os)
1304 {

Callers

nothing calls this directly

Calls 7

MapGetFirstElementAtFunction · 0.85
GetRideFunction · 0.85
SetRideTypeMethod · 0.80
getTypeMethod · 0.45
asTrackMethod · 0.45
GetRideIndexMethod · 0.45
isLastForTileMethod · 0.45

Tested by

no test coverage detected