๐ Game crashes when using the container to manage curios that add more curio slots when equipped
Not-February opened this issue ยท 0 comments
Convenient Curios container version
7_forge-1.19.2
Forge version
1.19.2 - 43.1.52
Additional mod(s) version (If bug is due incompatibility)
Enigmatic Legacy 2.26.4
Curios 5.1.1.0
Patchouli 1.19.2-77
Caelus API 3.0.0.6
Describe the bug
Using the curios container to manage curios which add other curio slots when equipped can cause the client to crash. It might have other unintended consequences than the instance described here.
I personally tested this with Enigmatic Legacy - which offers several charm slot items which grant the player another charm slot when worn. Equipping these isn't a problem - simply close the interface of the container and open it again, and the slots have updated.
The problem comes with swapping curios - attempting to swap the curio granting extra slots with a right click from within the container crashes the game. Manually swapping such a curio from the container by dragging the item onto it with your cursor also crashes the game.
Steps to reproduce
- Have a curios container
- Have the Charming Insignia(this one chosen for ease of use) from the creative menu, and at least one of any other charm in the container
- Equip the Charming Insignia. Observe how the slots do not automatically update
- Close the container
- Open the container; the slots are there now
- Right click the other charm in the container to quickly swap it with the first available slot. Observe the game crash
- Alternatively, click the other charm, move your cursor over the equipped Charming Insignia, and attempt to replace it this way. Observe the game crash
Crashlog
https://gist.github.com/Not-February/d1675c8108a1476473f0f662d5572942 | https://gist.github.com/Not-February/976e687ff51b72815266f641bae6cf17
Additional context
For the sake of explaining why I think this is a problem with this mod and not Enigmatic Legacy, another mod that I'd hazard a guess to be affected but haven't personally tested is Relics - the belts of which add a variable number of talisman slots when equipped that are lost when unequipped.
I imagine the same problem as described earlier would happen if you were to swap the belt out and the amount of talisman slots changed as a result.
Proposed solution:
I suggest the ability to dynamically change the rendering of slots based on this kind of scenario as is done in the default curios interface with these items, rather than setting it when the container is first opened.
Additionally:
Prevent items that alter slot availability like this from being swapped via the right click function if their added slots are currently in use. Maybe still allow swapping manually by moving the desired curio over the equipped one, but it cannot actually be swapped unless there is room in the container and/or the player's inventory to put the items currently equipped in slots depending on it.