Interkarma / daggerfall-unity

Open source recreation of Daggerfall in the Unity engine
http://www.dfworkshop.net
MIT License
2.67k stars 326 forks source link

Temporary Armour, Creates Infinitely Stacking "Value" Bug #2640

Open Yyffii opened 3 months ago

Yyffii commented 3 months ago

Describe the issue

When 'Temporary Items' (Create Item Spell Effect) expire while equipped the armour value is retained, this leads to an infinitely stackable armour value

To Reproduce

simply create a 1/1 duration create item spell, and equip then let expire armour, Repeat.

Expected behavior

the value should reset to the value of no armour in that slot since it has been "unequipped"

Screenshots and Logs

image image image

Desktop (please complete the following information):

Additional context

issue doesn't inherently lie within the create item script but any temporary item.

issue is possibly from DaggerfallWorkshop.Game.Items.ItemCollections.RemoveExpiredItems()

https://forums.dfworkshop.net/viewtopic.php?t=5681 forum post of issue from 2 years back - issue still in effect.

magicono43 commented 3 months ago

Here would be my potential suggested fix for this: 2024-04-11_20-01

That being, adding player.UpdateEquippedArmorValues(item, false); just under player.ItemEquipTable.UnequipItem(slotToCheck);

Yyffii commented 3 months ago

Update:

Equipping and unequpping different armours will not fix the bloated value, However Restarting seems to reset the values to zero.

ajrb commented 3 months ago

Yes this is the correct way to fix this issue magicono, so submit a PR? Or I can do it if you'd rather not.

magicono43 commented 3 months ago

Yes this is the correct way to fix this issue magicono, so submit a PR? Or I can do it if you'd rather not.

I would but my local branch has been all screwed up for a good few months, and I haven't gotten to fixing it, lol. If you want to make that PR that would be nice.