Skip to content

Commit

Permalink
Fixed #2878 Missing Bay Door on reload.
Browse files Browse the repository at this point in the history
  • Loading branch information
HoneySkull committed Sep 19, 2021
1 parent 6f7f552 commit ffb22b0
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions MekHQ/src/mekhq/campaign/parts/MissingBayDoor.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,15 @@ public void fix() {
unit.addPart(actualReplacement);
campaign.getQuartermaster().addPart(actualReplacement, 0);
replacement.decrementQuantity();

// Calling 'remove()' has the side effect of setting this.parentPart to null.
// Issue #2878
Part _parentPart = parentPart;
remove(false);
if (null != parentPart) {
parentPart.addChildPart(actualReplacement);
parentPart.updateConditionFromPart();

if (null != _parentPart) {
_parentPart.addChildPart(actualReplacement);
_parentPart.updateConditionFromPart();
}
}
}
Expand Down

0 comments on commit ffb22b0

Please sign in to comment.