mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-08 21:00:03 +01:00
fix: the bugs and vulnerabilities SonarCloud reports on PR #216
This commit is contained in:
@@ -367,11 +367,12 @@ editor_mode::selftest_result editor_mode::selftest_terrain(std::string const &co
|
||||
}
|
||||
// level off the rim within a centimetre
|
||||
double level{0.0};
|
||||
for (double off = 0.0; off <= length; off += 0.5)
|
||||
if (std::abs(height_at(off) - points[segment_data::point::start].y) <= 0.01)
|
||||
level = off;
|
||||
else
|
||||
break;
|
||||
double off{0.0};
|
||||
while (off <= length && std::abs(height_at(off) - points[segment_data::point::start].y) <= 0.01)
|
||||
{
|
||||
level = off;
|
||||
off += 0.5;
|
||||
}
|
||||
WriteLog(format("SELFTEST turntable %s track %s: at the rim %.3f m, %+.2f per mille over its first 5 m, level within 1 cm of the table for %.1f m; out along it%s", table.table->name().c_str(), track->name().c_str(), rim.y,
|
||||
1000.0 * (height_at(std::min(5.0, length)) - height_at(0.0)) / std::max(1e-6, std::min(5.0, length)), level, text.c_str()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user