sweet-org / sweet

A fitting calculator for the game Eve Echoes
MIT License
12 stars 6 forks source link

Integrated rig error on CyanSea #12

Closed Blaumeise03 closed 4 months ago

Blaumeise03 commented 8 months ago

Integrated rigs do not work properly on the CyanSea. If a rig is fitted into an integrated rig, the UI doesn't update. Also the rig will not be saved with the loadout. The attributes also do not get recalculated if a rig is being fitted, but after e.g. switching between skills the calculation does work properly.

It seems like the function FittingSimulator.fitItem is failing to fit it into the fitting loadout because the canFitModule says that the rig may not be fitted into the integrated rig.

https://github.com/sweet-org/sweet/blob/164b4872afe13182434dc65c44c2a56da9b66a7d/lib/service/fitting_simulator.dart#L766-L783

The rig is being inserted into the FittingRigIntegrator, but not into the FittingSimulator. This generates an inconsistent state inside the FittingSimulator, the rig is saved inside the _fitting attribute, but not inside the loadout. The former one gets used for the UI and calculations, the later one for saving. Also because the fitItem method is failing, _updateFitting() which notifies the listeners, the UI and the calculated values won't be updated without any further action.

Blaumeise03 commented 7 months ago

The bug was caused by the integrationMultiplier of the integrated rigs, it got also applied to the moduleCanFitAttributeID (ID 3000), which points for example to the moduleCanFitFitherRig (ID 3045) attribute. But when the multiplier gets applied, the value changes to an ID that does not exists (and thus defaults to 0), which prevents the rig from beeing fitted.