The construction process of an object which has Mass=0 set in DefCore leads to an engine crash due to an unsecure division by this value in C4Object::Build. Same holds for leaving this value out of DefCore because 0 is the default then. I found such objects on CCAN so this could happen in real world scenarios.
Though I don't know the code style guidelines very well this can be fixed by using
The construction process of an object which has
Mass=0
set in DefCore leads to an engine crash due to an unsecure division by this value inC4Object::Build
. Same holds for leaving this value out of DefCore because 0 is the default then. I found such objects on CCAN so this could happen in real world scenarios.Though I don't know the code style guidelines very well this can be fixed by using
instead of https://github.com/legacyclonk/LegacyClonk/blob/master/src/C4Object.cpp#L1734 without breaking anything because
Def->Mass
is used are okay with 0The fix is just a suggestion from my side. You can use any other value (or maybe something else?).