1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-26 16:24:35 +01:00

#15367: Encode RideType in TrackElement

This commit is contained in:
frutiemax
2021-09-14 19:36:58 -04:00
committed by Gymnasiast
parent c56810e6a5
commit 355019f97f
9 changed files with 28 additions and 3 deletions

View File

@@ -244,6 +244,7 @@ bool track_add_station_element(CoordsXYZD loc, ride_id_t rideIndex, int32_t flag
targetTrackType = TrackElemType::MiddleStation;
}
stationElement->AsTrack()->SetTrackType(targetTrackType);
stationElement->AsTrack()->SetRideType(ride->type);
map_invalidate_element(loc, stationElement);
@@ -389,6 +390,7 @@ bool track_remove_station_element(const CoordsXYZD& loc, ride_id_t rideIndex, in
}
}
stationElement->AsTrack()->SetTrackType(targetTrackType);
stationElement->AsTrack()->SetRideType(ride->type);
map_invalidate_element(currentLoc, stationElement);
}
@@ -730,6 +732,16 @@ void TrackElement::SetTrackType(uint16_t newType)
TrackType = newType;
}
uint8_t TrackElement::GetRideType() const
{
return RideType;
}
void TrackElement::SetRideType(const uint8_t rideType)
{
RideType = rideType;
}
uint8_t TrackElement::GetSequenceIndex() const
{
return Sequence;