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

fix(sleepers): the timbers a switch shares with a track with no model of timbers of its own laid of the model of the switch, not of the one of eu07.ini without the fastenings: the model of a track with none of its own that of the tracks most of its timbers carry with one, and a timber carrying none of them, as under the short tracks between the halves of a slip, of the model of the nearest timber with one up to 1.5 m away; the fastenings and checkseats selftests take the model the same way

This commit is contained in:
maj00r
2026-10-24 02:18:58 +02:00
parent 81a6b855d0
commit 540dae420f
7 changed files with 72 additions and 8 deletions

View File

@@ -156,7 +156,8 @@ editor_mode::selftest_result editor_mode::selftest_sleepers(std::string const &c
std::string name, detail;
words >> name >> detail;
auto *track{simulation::Paths.find(name)};
auto const *model{track != nullptr ? track_sleepers::timber_model(*track) : nullptr};
auto const beams{track != nullptr ? track_sleepers::place(*track) : std::vector<track_sleepers::beam>{}};
auto const *model{track != nullptr ? track_sleepers::timber_model(*track, beams) : nullptr};
if (model == nullptr || false == model->fastened())
{
WriteLog("SELFTEST fastenings: no track " + name + " with the fastenings in the model of its timbers");
@@ -164,7 +165,7 @@ editor_mode::selftest_result editor_mode::selftest_sleepers(std::string const &c
}
track_sleepers::fastened_rails const rails{*track};
std::array<int, track_sleepers::part_count> counts{};
for (auto const &beam : track_sleepers::place(*track))
for (auto const &beam : beams)
{
if (beam.plain)
continue;