17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-09 17:12:46 +01:00

fix: the bugs and vulnerabilities SonarCloud reports on PR #216

This commit is contained in:
2026-11-07 22:11:08 +01:00
parent 8e85def98f
commit 7667e5b2ec
65 changed files with 910 additions and 121 deletions

View File

@@ -1980,14 +1980,16 @@ std::optional<lay_result> lay_on(lay_request const &Request)
auto const step{std::max(0.5, radius * glm::radians(2.0))};
double low{0.0};
double high{-1.0};
for (auto arc{step}; arc < 2.0 * kPi * radius; arc += step)
auto tried{step};
while (tried < 2.0 * kPi * radius)
{
if (miss(arc)[0] <= 0.0)
if (miss(tried)[0] <= 0.0)
{
high = arc;
high = tried;
break;
}
low = arc;
low = tried;
tried += step;
}
if (high < 0.0)
return std::nullopt;