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

fix(track): two switches laid right after one another, with no plain track between them, are joined, the vehicles no longer derail there: only the plain tracks looked for their neighbours, so the end of the main track of one switch at the start of the next one was joined to nothing, and an axle getting to it ran onto a track made to derail it. TTrack::join_switches joins the free ends of a switch to the ends of other switches in the same points, on both sides, with the codes of the ends the axles go on by: the end of either path of one at the start of the other, two facing at their starts, two meeting at their ends; done once the plain tracks are joined as the scenery is loaded, the old sceneries too, and as the editor joins a switch laid. Selftest pathwalk walks the tracks as an axle does: P2 to P1, P4 to P1, start to start and end to end go through either way

This commit is contained in:
maj00r
2026-10-26 20:40:51 +01:00
parent bfb045f2ad
commit 476909581f
4 changed files with 105 additions and 0 deletions

View File

@@ -1143,6 +1143,8 @@ void editor_track::join(TTrack &Track)
join(*other);
}
}
// and a switch right after another one
Track.join_switches();
break;
}
default: