Browse Source

only verify integer type for parent index

main
cinnaboot 6 months ago
parent
commit
915e32147a
  1. 3
      src/config_loader.cpp

3
src/config_loader.cpp

@ -55,9 +55,8 @@ static bool parse_toml_body(toml_datum_t body_table, CelestialBody* body) {
toml_datum_t eccentricity = toml_get(body_table, "eccentricity");
toml_datum_t semi_major = toml_get(body_table, "semi_major_axis");
// Accept both INT64 and FP64 for parent_index (TOML may parse integers as floats)
if (mass.type != TOML_FP64 || radius.type != TOML_FP64 ||
(parent_idx.type != TOML_INT64 && parent_idx.type != TOML_FP64) ||
parent_idx.type != TOML_INT64 ||
eccentricity.type != TOML_FP64 ||
semi_major.type != TOML_FP64) {
return false;

Loading…
Cancel
Save