So I was playing in the recent Oangband Shadow Fairy Mage competition, and I was annoyed by a bug I kept hitting: if I was a full mana, and then saved the game (cntrl-X), when I restored it I had less than full mana. It annoyed me enough that I tracked it down: in update_stuff() in file xtra1.c, the call to calc_mana() comes *before* the call to calc_specialty(). This means that the very first time calc_mana() is called after a savefile reload, the value of p_ptr->specialties_allowed has not yet been updated and so is still zero. This in turn means that the bonus for having the "Clarity" special ability isn't being counted the first time that calc_mana() is called.
The fix that I chose is simple: I just moved the block of code that checks for and calls calc_speciality to be the first such block in the update_stuff() routine.
The fix that I chose is simple: I just moved the block of code that checks for and calls calc_speciality to be the first such block in the update_stuff() routine.
Comment