PDA

View Full Version : 5E Bug - Armor not Consistently Updating AC



MeAndUnique
December 4th, 2022, 16:46
Right now all of the logic for adjusting AC when armor is equipped lives directly in the inventory list. This means that if the DM uses the Party sheet to distribute armor to a PC when their inventory hasn't been opened, the armor will get marked as equipped in the list, however the PC's AC won't update accordingly. A cursory look suggests that moving the onArmorChanged function from char_invlist.lua to a global manager, perhaps manager_char_armor.lua, will fix the bug. To reproduce:

Create new 5E campaign.
Create new PC and give them a name (do not open inventory tab).
Load any module containing armor (e.g. 5E SRD Data).
Open party sheet to inventory tab.
Add any armor to the party sheet (e.g. Hide).
Set the PCs name in the assignment line for the armor
Hit the Distribute button.
Notice the AC on the PC has not changed.
For completeness, you can view the expected AC by unequipping and re-equipping the armor in the inventory.

Moon Wizard
December 7th, 2022, 18:42
Luckily, this seems like it's a pretty rare situation, since it hasn't come up before and the code has been set up that way for quite a long time.

I'll look at generalizing for a future update to handle this case.

Regards,
JPG