pioneerspacesim / pioneer

A game of lonely space adventure
https://pioneerspacesim.net
1.58k stars 364 forks source link

Fix location recovery #5801

Closed Gliese852 closed 1 month ago

Gliese852 commented 2 months ago

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.

Gliese852 commented 2 months ago

@Web-eWorks in fact, it is also needed in the opposite case, in the implicit else, if the ship is saved in space.