We're updating the issue view to help you get more done. 

Factory installed items in slots with capacity cause issue when filling slot

Description

This is a generic error for all items with capacity and factory pre-installed items.

Example 1:
imaging_scope has capacity="3" and comes with 2 free installed items
<itemhookmod capacity="3" hook="OPTICAL"/>
<accessorymod hook="OPTICAL" item="vision_magnification" included="true"/>
<accessorymod hook="OPTICAL" item="camera" included="true"/>

This setup is shown correctly in editor (both items are shown, with 3 free slots). It is possible to add 2 items. When trying to add the third item, Genesis creates an error.

2020-09-11 20:25:59.394 ERROR [shadowrun6.jfx.items] (AvailableSlotPane.java:258) - Failed asking for Options
java.lang.IllegalStateException: Cannot add any more items. Already have 4 of 3/OPTICAL : [CarriedItem vision_magnification:null (Mods: 1) (AutoMods: 0), CarriedItem camera:null (Mods: 0) (AutoMods: 0), CarriedItem flare_compensation:null (Mods: 0) (AutoMods: 0), CarriedItem thermographic_vision:null (Mods: 0) (AutoMods: 0)]

It seems the 2 free items are counted towards the limit of 3, thus Genesis thinks there are already 4 itmes in the scope, which should not be allowed, thus creates the error.

Example 2:
cybereye1 has capacity=”1” and comes with 2 free installed items.
<itemhookmod capacity="1" hook="CYBEREYE_IMPLANT"/>
<accessorymod hook="CYBEREYE_IMPLANT" item="image_link" included="true"/>
<accessorymod hook="CYBEREYE_IMPLANT" item="camera" included="true"/>

This setup is shown correctly in editor (both items are shown, with 1 free slot). When trying to add an item, Genesis creates an error.

2020-09-12 08:56:38.573 ERROR [shadowrun6.jfx] (NewEditCarriedItemDialog.java:410) - Failed asking for Options
java.lang.IllegalStateException: Cannot add any more items. Already have 2 of 1/CYBEREYE_IMPLANT : [CarriedItem image_link:null (Mods: 0) (AutoMods: 0), CarriedItem camera:null (Mods: 0) (AutoMods: 0)]

Environment

None

Assignee

Stefan Prelle

Reporter

Robert

Labels

None

Priority

Medium
Configure