Skip to content

Commit

Permalink
Convert spinners to use actual Bay minDoors values
Browse files Browse the repository at this point in the history
  • Loading branch information
Sleet01 committed Dec 27, 2024
1 parent 80575b4 commit 3cd0bbe
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions megameklab/src/megameklab/ui/generalUnit/TransportTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ private boolean canAddSelectedBay() {
return false;
}
BayData bayType = modelAvailable.getBayType(tblAvailable.convertRowIndexToModel(selected));
return (doorsAvailable() > 0) || bayType.isInfantryBay();
return (doorsAvailable() >= bayType.getMinDoors());
}

/**
Expand Down Expand Up @@ -867,7 +867,10 @@ public void stateChanged(ChangeEvent e) {
refreshDockingHardpoints();

} else if (column == InstalledBaysModel.COL_DOORS) {
modelInstalled.bayList.get(row).setDoors((Integer) getCellEditorValue());
int value = (Integer) getCellEditorValue();
modelInstalled.bayList.get(row).setDoors(
Math.max(value, bay.getMinDoors())
);
}
modelInstalled.fireTableRowsUpdated(row, row);
checkButtons();
Expand Down

0 comments on commit 3cd0bbe

Please sign in to comment.