crnormand / gurps

Implementing a GURPS 4e game aid for Foundry VTT
MIT License
102 stars 49 forks source link

Fix contained items not being equipped and unequipped with the container item #1931

Closed Wilou1428 closed 1 month ago

Wilou1428 commented 1 month ago

When equipping and unequipping items in the character sheet their contained items don't update. This doesn't make sense and makes items like holsters, sheaths, backpacks and bags more cumbersome to use.

The changing equip status of child items requires a recursive through the contained items and is part of the updateItemAdditionsBasedOn logic already only for carried status I took a liberty to expand it for the equipped status as well.

I also had to change the order of operations in _onClickEquip because internalUpdate should be called only when all the eqt.equipped values were changed.

I also did a bit of refactoring of the code documentation.