From a6e39ba77f91dbf2620c70b32eb73afd50be8697 Mon Sep 17 00:00:00 2001 From: maj00r Date: Wed, 14 Oct 2026 00:03:06 +0200 Subject: [PATCH] feat(track): frogs, crossings and shared running surfaces only for the rail profiles the sceneries of the package use: tracks without a profile, default, s60, uic60 and s39; rails of other profiles are laid whole again --- world/TrackRails.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/world/TrackRails.cpp b/world/TrackRails.cpp index 5bd2436f..0295479a 100644 --- a/world/TrackRails.cpp +++ b/world/TrackRails.cpp @@ -94,6 +94,12 @@ gauge_line make_gauge_line( TSegment const &Segment, double const Offset, double return line; } +bool cut_profile( std::string Profile ) { + + std::transform( Profile.begin(), Profile.end(), Profile.begin(), []( unsigned char const Char ) { return static_cast( std::tolower( Char ) ); } ); + return Profile.empty() || Profile == "default" || Profile == "s60" || Profile == "uic60" || Profile == "s39"; +} + bool joined( TTrack const &Track, TTrack const &Other ) { auto const next = []( TTrack const &From, TTrack const &To ) { @@ -176,6 +182,7 @@ bool cut_rails( TTrack const &Track ) { return ( Track.iCategoryFlag & 15 ) == 1 && Track.m_material1 != null_handle && false == Track.m_editorremoved + && cut_profile( Track.m_profile1.first ) && ( Track.eType == tt_Normal ? Track.Segment != nullptr : Track.eType == tt_Switch && Track.SwitchExtension && Track.SwitchExtension->m_frogs && Track.SwitchExtension->Segments[ 0 ] && Track.SwitchExtension->Segments[ 1 ] ); }