Interkarma / daggerfall-unity

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

Fix spell absorption capping #2680

Closed petchema closed 1 month ago

petchema commented 4 months ago

When absorbing magicka from own spells, DFU explicitly ensures that magicka recovered is not larger than the magicka that was used. For this, it needs to track how much magicka was spent for the last spell: lastReadySpellCastingCost

A special case was not correctly handled though: when the last spell came from a magic item, lastReadySpellCastingCost should be set 0 so that next absorption of own spells is not capped. That worked by luck when the game was just started because lastReadySpellCastingCost was still 0, but broke after first spell casting.

Forums: https://forums.dfworkshop.net/viewtopic.php?t=6755

petchema commented 3 months ago

Test protocol:

(sorry for the traces of french translation mod in the save) SAVE37.zip