It turned out that the index of the system body in the path does not always coincide with its index in the save file, because when saving there is a separate indexing.
In addition, if there are gravpoints in the system, the numbering of physical bodies and system bodies also differs, what was not taken into account.
(This led to errors when recovering the location.)
Fortunately, the physical body (planet or station) has a reference to the serializable index of the system body (index_for_system_body), and this way the reliable connection can be found.
It turned out that the index of the system body in the path does not always coincide with its index in the save file, because when saving there is a separate indexing.
In addition, if there are gravpoints in the system, the numbering of physical bodies and system bodies also differs, what was not taken into account.
(This led to errors when recovering the location.)
Fortunately, the physical body (planet or station) has a reference to the serializable index of the system body (
index_for_system_body
), and this way the reliable connection can be found.