Skip to content

Commit 0496d05

Browse files
committed
Issue 6178: Ammo Bins should use the Quartermaster to get ammo, not the warehouse
1 parent 7f09e3c commit 0496d05

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

MekHQ/src/mekhq/campaign/parts/Part.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,13 @@ public String getDesc() {
453453
toReturn.append("</b><br/>").append(getDetails()).append("<br/>");
454454
}
455455

456-
if (campaign.getWarehouse() != null) {
456+
if (this instanceof mekhq.campaign.parts.equipment.AmmoBin ammoBin) {
457+
if (campaign.getQuartermaster() != null) {
458+
toReturn.append("<br> <b>In Warehouse:</b> ")
459+
.append(campaign.getQuartermaster().getAmmoAvailable(ammoBin.getType()))
460+
.append(' ');
461+
}
462+
} else if (campaign.getWarehouse() != null) {
457463
toReturn.append("<br> <b>In Warehouse:</b> ")
458464
.append(campaign.getWarehouse().getSparePartsCount(this))
459465
.append(' ');

0 commit comments

Comments
 (0)