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

Switch to strong references instead of IDs for child parts #2088

Conversation

sixlettervariables
Copy link
Collaborator

I have never reliably reproduced the issues seen with child parts (such as bay doors, etc), but have always disliked our usage of IDs instead of strong references. MekHQ plays loose with IDs in order to aggregate spare parts and I'm not confident it isn't a cause of these problems.

I'm only confident this will resolve the class of errors where the part ID changed but the child part IDs were not updated.

Copy link
Member

@Windchild292 Windchild292 left a comment

Choose a reason for hiding this comment

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

This looks good to me, just a few comments.

MekHQ/src/mekhq/campaign/parts/MissingBattleArmorSuit.java Outdated Show resolved Hide resolved
MekHQ/src/mekhq/campaign/parts/MissingBattleArmorSuit.java Outdated Show resolved Hide resolved
MekHQ/src/mekhq/campaign/parts/BattleArmorSuit.java Outdated Show resolved Hide resolved
MekHQ/src/mekhq/campaign/parts/BattleArmorSuit.java Outdated Show resolved Hide resolved
MekHQ/src/mekhq/campaign/parts/BattleArmorSuit.java Outdated Show resolved Hide resolved
MekHQ/src/mekhq/campaign/parts/BattleArmorSuit.java Outdated Show resolved Hide resolved
MekHQ/src/mekhq/campaign/Campaign.java Outdated Show resolved Hide resolved
MekHQ/src/mekhq/campaign/parts/Part.java Outdated Show resolved Hide resolved
MekHQ/src/mekhq/campaign/parts/Part.java Show resolved Hide resolved
MekHQ/src/mekhq/campaign/parts/Part.java Show resolved Hide resolved
@sixlettervariables sixlettervariables merged commit 032d917 into MegaMek:master Oct 2, 2020
@sixlettervariables sixlettervariables deleted the avoid-child-part-ref-errors branch October 8, 2020 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants