fix: hull restriction filtering was too strict (#137)

This commit is contained in:
Patric Stout
2024-05-26 14:40:59 +02:00
committed by GitHub
parent 67422a887c
commit d8bb534526

View File

@@ -275,11 +275,6 @@ export const HardwareListing = () => {
attr.attributeID === eveData.attributeMapping.canFitShipType10 ||
attr.attributeID === eveData.attributeMapping.canFitShipType11,
);
/* If there is a restriction, check if this ship matches. */
if (canFitShipType.length > 0) {
if (canFitShipType.filter((attr) => attr.value === shipType).length === 0) continue;
}
const canFitShipGroup = eveData.typeDogma[typeId]?.dogmaAttributes.filter(
(attr) =>
attr.attributeID === eveData.attributeMapping.canFitShipGroup01 ||
@@ -303,9 +298,13 @@ export const HardwareListing = () => {
attr.attributeID === eveData.attributeMapping.canFitShipGroup19 ||
attr.attributeID === eveData.attributeMapping.canFitShipGroup20,
);
/* If there is a restriction, check if this ship matches. */
if (canFitShipGroup.length > 0) {
if (canFitShipGroup.filter((attr) => attr.value === shipGroup).length === 0) continue;
/* If there is a fit restriction, check if this ship matches. */
if (canFitShipType.length > 0 || canFitShipGroup.length > 0) {
const fitGroup = canFitShipGroup.find((attr) => attr.value === shipGroup);
const fitType = canFitShipType.find((attr) => attr.value === shipType);
if (fitGroup === undefined && fitType === undefined) continue;
}
}
} else {