Fix rigs never passing fitting check because no cpu

This commit is contained in:
2025-12-06 01:37:08 +01:00
parent 4ddf1733e4
commit 457bbc0dc3

View File

@@ -240,7 +240,20 @@ class ItemView(Display):
fittingItems = []
for item in items:
# Check CPU and power requirements first (fastest check)
# Check if item is a module (has a slot)
slot = Module.calculateSlot(item)
if slot is None:
continue
# Rigs don't use CPU/power, they use calibration - allow them through
if slot == FittingSlot.RIG:
# Check if item can fit on the ship
if not fit.canFit(item):
continue
fittingItems.append(item)
continue
# For non-rigs, check CPU and power requirements
itemCpu = item.attributes.get("cpu")
itemPower = item.attributes.get("power")
@@ -260,11 +273,6 @@ class ItemView(Display):
if itemPowerValue > pgRemaining:
continue
# Check if item is a module (has a slot)
slot = Module.calculateSlot(item)
if slot is None:
continue
# Check if item can fit on the ship (most expensive check, do last)
if not fit.canFit(item):
continue