Filter rigs by calibration fits as well
This commit is contained in:
@@ -238,6 +238,13 @@ class ItemView(Display):
|
||||
cpuRemaining = cpuOutput - cpuUsed
|
||||
pgRemaining = powerOutput - pgUsed
|
||||
|
||||
# Get remaining calibration (for rigs)
|
||||
calibrationCapacity = fit.ship.getModifiedItemAttr("upgradeCapacity")
|
||||
calibrationUsed = fit.calibrationUsed
|
||||
calibrationRemaining = None
|
||||
if calibrationCapacity is not None and calibrationCapacity > 0:
|
||||
calibrationRemaining = calibrationCapacity - calibrationUsed
|
||||
|
||||
fittingItems = []
|
||||
for item in items:
|
||||
# Check if item is a module (has a slot)
|
||||
@@ -245,7 +252,7 @@ class ItemView(Display):
|
||||
if slot is None:
|
||||
continue
|
||||
|
||||
# Rigs don't use CPU/power, they use calibration - check rig size compatibility
|
||||
# Rigs don't use CPU/power, they use calibration - check rig size and calibration
|
||||
if slot == FittingSlot.RIG:
|
||||
# Check if item can fit on the ship
|
||||
if not fit.canFit(item):
|
||||
@@ -256,6 +263,13 @@ class ItemView(Display):
|
||||
if shipRigSize is not None and itemRigSize is not None:
|
||||
if shipRigSize != itemRigSize.value:
|
||||
continue
|
||||
# Check calibration requirement
|
||||
if calibrationRemaining is not None and calibrationRemaining > 0:
|
||||
itemCalibration = item.attributes.get("upgradeCost")
|
||||
if itemCalibration is not None:
|
||||
itemCalibrationValue = itemCalibration.value
|
||||
if itemCalibrationValue > calibrationRemaining:
|
||||
continue
|
||||
fittingItems.append(item)
|
||||
continue
|
||||
|
||||
|
||||
Reference in New Issue
Block a user