Skip to content

Fix connector system display and map rendering bugs#8837

Merged
HammerGS merged 1 commit into
mainfrom
fix/connector-system-display-bugs
Mar 27, 2026
Merged

Fix connector system display and map rendering bugs#8837
HammerGS merged 1 commit into
mainfrom
fix/connector-system-display-bugs

Conversation

@HammerGS

Copy link
Copy Markdown
Member
  • PlanetarySystem.getName(): Check if primarySlot was explicitly defined rather than checking the defaulted value. Systems without primarySlot (e.g. connector systems like TFS 31) now correctly display their system ID instead of the first planet's generic name (e.g. "U-1").

  • InterstellarMapPanel: Fix NPE when rendering factions without a capital in the capitals map. Reversed the equals() call so the non-null system ID is the receiver.

- PlanetarySystem.getName(): Check if primarySlot was explicitly defined
  rather than checking the defaulted value. Systems without primarySlot
  (e.g. connector systems like TFS 31) now correctly display their system
  ID instead of the first planet's generic name (e.g. "U-1").

- InterstellarMapPanel: Fix NPE when rendering factions without a capital
  in the capitals map. Reversed the equals() call so the non-null
  system ID is the receiver.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 26, 2026 23:08
@HammerGS HammerGS requested a review from a team as a code owner March 26, 2026 23:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes two UI/data edge cases affecting connector systems and interstellar map rendering by correcting how a system’s display name is derived when primarySlot is absent, and by preventing a null-pointer during faction-capital highlighting.

Changes:

  • Update PlanetarySystem.getName() to detect whether primarySlot was explicitly provided (vs. defaulted) and fall back to system ID for connector systems.
  • Prevent an NPE in InterstellarMapPanel when a faction has no starting planet/capital entry by making the equals() receiver non-null.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
MekHQ/src/mekhq/gui/InterstellarMapPanel.java Avoids NPE during faction-capital rendering by reversing the equals() call.
MekHQ/src/mekhq/campaign/universe/PlanetarySystem.java Corrects naming behavior for systems without an explicitly defined primarySlot by returning the system ID.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@HammerGS HammerGS added AI Generated Code AI-generated fix. Requires human testing and review before merging. AI ready for Review Indicates that is has been in game tested and is ready for review as it can be labels Mar 27, 2026
@HammerGS HammerGS merged commit 641d03b into main Mar 27, 2026
11 checks passed
@HammerGS HammerGS deleted the fix/connector-system-display-bugs branch March 27, 2026 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Generated Code AI-generated fix. Requires human testing and review before merging. AI ready for Review Indicates that is has been in game tested and is ready for review as it can be

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants