Skip to content

Commit 42d5b1c

Browse files
committed
Don't create moons with 0kg mass
1 parent 6607053 commit 42d5b1c

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/galaxy/StarSystemGenerator.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,6 +1130,9 @@ SystemBody *StarSystemRandomGenerator::MakeBodyInOrbitSlice(Random &rand, StarSy
11301130

11311131
mass *= discDensity;
11321132

1133+
if (mass == fixed(0, 1))
1134+
return nullptr; // We used our best math, but this body just turned out too small, sorry.
1135+
11331136
if (mass.v < 0) { // hack around overflow
11341137
Output("WARNING: planetary mass has overflowed! (child %d of %s)\n", primary->GetNumChildren(), primary->GetName().c_str());
11351138
mass = fixed(Sint64(0x7fFFffFFffFFffFFull));

0 commit comments

Comments
 (0)