Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix custom systems with zero stars #5858

Merged
merged 5 commits into from
Jul 10, 2024

Conversation

sturnclaw
Copy link
Member

This PR fixes #5857 - the primary issue was that StarSystem::m_stars wasn't being properly populated when creating a new system and adding stars to that system. As a consequence, the game thought there were no stars within the generated system and that exposed a host of bugs related to rendering and processing a system without stars.

I've fixed most of the bugs related to a lack of stars which I found, but didn't perform an exhaustive search to see if there were any I missed in other parts of the game or UI.

I've also fixed a problem which lead to hilariously out-of-range values being set for a system's position within its sector when creating a new system "from scratch". As usual, just another variable which didn't get initialized properly.

sturnclaw added 5 commits July 9, 2024 14:40
- If a system in a sector has zero stars, the sector map would previously crash attempting to display it.
- Fall back to displaying it as though it contained an M-class star, as empty star systems are a degenerate case.
- If a system is empty or contains objects with no luminance, an extremely bright object was generated.
- Special-case zero-luminance to avoid graphical issues.
- Only encountered when creating a new system in the system editor, but lead to hilariously out-of-place stars in the map.
…ly-created systems

- The star list was loaded correctly for systems copied from existing systems
- Creating a new system would not populate the list of stars, leading to failures in code which depended on StarSystem::GetStarType()
@sturnclaw sturnclaw merged commit 447c351 into pioneerspacesim:master Jul 10, 2024
5 checks passed
@sturnclaw sturnclaw deleted the fix-zero-system-stars branch July 19, 2024 02:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom systems segfault when you attempt to view them in the map
1 participant