17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-17 03:59:19 +02:00

fix(vehicles): vehicle placed with a switch as its first path no longer reads the direction of a previous path it doesn't have; vehicle put back on the track keeps the direction of its axles

This commit is contained in:
maj00r
2026-10-06 22:19:12 +02:00
parent f5d328c3a5
commit 084a705452
2 changed files with 5 additions and 2 deletions

View File

@@ -51,6 +51,9 @@ TTrack * TTrackFollower::SetCurrentTrack(TTrack *pTrack, int end)
{
case tt_Switch: // jeśli zwrotnica, to przekładamy ją, aby uzyskać dobry segment
{
if( pCurrentTrack == nullptr ) {
break;
}
int i = end ? pCurrentTrack->iNextDirection : pCurrentTrack->iPrevDirection;
if (i > 0) // jeżeli wjazd z ostrza
pTrack->SwitchForced(i >> 1, Owner); // to przełożenie zwrotnicy - rozprucie!