Skip to content

Commit

Permalink
Correct the clamp range, restore the assert
Browse files Browse the repository at this point in the history
  • Loading branch information
fluffyfreak committed Feb 29, 2024
1 parent f20ff94 commit a365298
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/galaxy/StarSystemGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1292,7 +1292,8 @@ SystemBody* StarSystemRandomGenerator::MakeGravPointForBodies(RefCountedPtr<Star

char StarSystemRandomGenerator::GetStarSuffixFromOffset(const int offsetId) const
{
return 'A' + Clamp(offsetId, 0, 26);
assert((offsetId >= 0) && (offsetId <= 25));
return 'A' + Clamp(offsetId, 0, 25);
}

SystemBody* StarSystemRandomGenerator::PlaceStars(Random &rng, RefCountedPtr<StarSystem::GeneratorAPI> system, const Sector::System &secSys, const int offset, const int numStars, const fixed maxMass = fixed())
Expand Down

0 comments on commit a365298

Please sign in to comment.