Fix to #790: Ping errors solved.#795
Conversation
|
Already handled by #794. There's also a few issues I see with this PR as well: First, this PR will always snap to nearest world objects when pinging, which may be undesirable when trying to ping near such an object. Second, this PR assumes that a planet layer with higher ID will be further away from the planet, which simply is not true - it's just merely the order at which those were loaded by the game. It also doesn't handle situations where a planet layer is not related to the planet. Both can be seen with the mod "Layered Atmosphere and Orbit", where you can see that orbital pings can be seen in layers that are closer to the planet. Likewise, planet pings are visible when switching to the moon (those pings are floating above them moon). Third, the code checks for the layer right before drawing the ping itself, rather than continuing the loop early (like the rest of the code). This is not something major, but this basically means that we need to calculate the center position of the tile even if we don't draw the ping. And finally, rather than checking for tile validity by checking if its tile ID is -1, the check should use the |
|
Closing, should be handled by #794 (but with some extra safety). |
Fixed the invalid index exception described in #790.
Pings will now snap to nearest valid item (i.e. asteroid if in space.)
Added a check to ensure ping location is valid.
Only draw pings if its location is logically visible. (If in space you can see the pings on the planet, if on the planet you cannot see pings in orbit.)