mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-28 09:14:58 +01:00
Make steep Log Flume pieces in older parks invisible
This commit is contained in:
@@ -982,7 +982,7 @@ namespace OpenRCT2
|
||||
|
||||
auto found = os.ReadWriteChunk(
|
||||
ParkFileChunkType::TILES,
|
||||
[pathToSurfaceMap, pathToQueueSurfaceMap, pathToRailingsMap](OrcaStream::ChunkStream& cs) {
|
||||
[pathToSurfaceMap, pathToQueueSurfaceMap, pathToRailingsMap, &os](OrcaStream::ChunkStream& cs) {
|
||||
cs.ReadWrite(gMapSize.x);
|
||||
cs.ReadWrite(gMapSize.y);
|
||||
|
||||
@@ -1018,6 +1018,16 @@ namespace OpenRCT2
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (it.element->GetType() == TileElementType::Track)
|
||||
{
|
||||
auto* trackElement = it.element->AsTrack();
|
||||
if (TrackTypeMustBeMadeInvisible(
|
||||
trackElement->GetRideType(), trackElement->GetTrackType(),
|
||||
os.GetHeader().TargetVersion))
|
||||
{
|
||||
it.element->SetInvisible(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
ParkEntranceUpdateLocations();
|
||||
|
||||
@@ -8,7 +8,7 @@ struct ObjectRepositoryItem;
|
||||
namespace OpenRCT2
|
||||
{
|
||||
// Current version that is saved.
|
||||
constexpr uint32_t PARK_FILE_CURRENT_VERSION = 15;
|
||||
constexpr uint32_t PARK_FILE_CURRENT_VERSION = 16;
|
||||
|
||||
// The minimum version that is forwards compatible with the current version.
|
||||
constexpr uint32_t PARK_FILE_MIN_VERSION = 14;
|
||||
|
||||
@@ -1692,6 +1692,11 @@ namespace RCT1
|
||||
dst2->SetMazeEntry(src2->GetMazeEntry());
|
||||
}
|
||||
|
||||
if (TrackTypeMustBeMadeInvisible(rideType, trackType))
|
||||
{
|
||||
dst->SetInvisible(true);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
case TileElementType::SmallScenery:
|
||||
|
||||
@@ -1442,6 +1442,11 @@ namespace RCT2
|
||||
dst2->SetSeatRotation(src2->GetSeatRotation());
|
||||
}
|
||||
|
||||
if (TrackTypeMustBeMadeInvisible(rideType, dst2->GetTrackType()))
|
||||
{
|
||||
dst->SetInvisible(true);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case RCT12TileElementType::SmallScenery:
|
||||
|
||||
@@ -918,3 +918,20 @@ void TrackElement::SetHighlight(bool on)
|
||||
if (on)
|
||||
Flags2 |= TRACK_ELEMENT_FLAGS2_HIGHLIGHT;
|
||||
}
|
||||
|
||||
bool TrackTypeMustBeMadeInvisible(ride_type_t rideType, track_type_t trackType, int32_t parkFileVersion)
|
||||
{
|
||||
// Lots of Log Flumes exist where the downward slopes are simulated by using other track
|
||||
// types like the Splash Boats, but not actually made invisible, because they never needed
|
||||
// to be.
|
||||
if (rideType == RIDE_TYPE_LOG_FLUME && parkFileVersion <= 15)
|
||||
{
|
||||
if (trackType == TrackElemType::Down25ToDown60 || trackType == TrackElemType::Down60
|
||||
|| trackType == TrackElemType::Down60ToDown25)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -634,3 +634,16 @@ ResultWithMessage track_remove_station_element(const CoordsXYZD& loc, RideId rid
|
||||
|
||||
bool TrackTypeHasSpeedSetting(track_type_t trackType);
|
||||
std::optional<CoordsXYZD> GetTrackSegmentOrigin(const CoordsXYE& posEl);
|
||||
|
||||
/**
|
||||
* If new pieces get added to existing ride types, this could cause existing parks to change appearance,
|
||||
* since the formerly unrendered pieces were not explicitly set invisible.
|
||||
* To avoid this, this function will return true if the piece is question was added after the park was created,
|
||||
* so that import code can properly set the visibility.
|
||||
*
|
||||
* @param rideType The OpenRCT2 ride type
|
||||
* @param trackType The OpenRCT2 track type
|
||||
* @param parkFileVersion The current park file version. Pass -1 when converting S4 or S6.
|
||||
* @return
|
||||
*/
|
||||
bool TrackTypeMustBeMadeInvisible(ride_type_t rideType, track_type_t trackType, int32_t parkFileVersion = -1);
|
||||
|
||||
Reference in New Issue
Block a user