Closing the Debug menu unexpectedly alters player stats

Issue #309 resolved
Former user created an issue

Opening and closing the Debug menu (regardless of the actions performed) modifies player's HP by about -25% and increased Mana by a certain amout sometimes. Presumably, reapplies equpment's mana modifiers. For ex. by 10 with emerald circlet equipped and by 20 with both emerald circlet and paladin armor. That said, the Mana change might not happen rather arbitrarily. For ex. if the player uses a temporary body gained from the Ooze queen, only the HP alteration takes place.

Occures presumably on all the floors, after a save reload, after a game restart.

Comments (2)

  1. NeKochan32

    So, I pretty much found the issue. Thing is: when the debug menu is initialized, it modifies player’s HP and Mana is accordance to GetMaxHealth() and GetMaxMana() methods and assigns these to its maxHealth and maxMana boxes, so the user won’t see something like ‘mana 300 out of 100'. But then the debug menu assigns the raw value of the box to the respective player’s stats, which basically modifies them an extra time compared to the base value and save the result as a new base value, which causes the issue in question.

    The solution would be not too complicated in its design, so I’ll leave the implementation to you. It’d require either additonal ‘HP base' and ‘Mana base’ boxes (and make the actual max values read-only), which were removed in v11, or some background math, which I wouldn’t personally recommend. Thanks for the work!

  2. Log in to comment