Skip to content

Commit

Permalink
Bugfix: lost mana when cancelling a mage spell
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcook committed Jun 4, 2020
1 parent 1ef783c commit d9e3fef
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/mage_spells.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,14 +239,18 @@ void getAndCastMagicSpell() {
} else {
castSpell(choice + 1);

if ((py.flags.spells_worked & (1L << choice)) == 0) {
if (!game.player_free_turn && (py.flags.spells_worked & (1L << choice)) == 0) {
py.misc.exp += magic_spell.exp_gain_for_learning << 2;
py.flags.spells_worked |= (1L << choice);

displayCharacterExperience();
}
}

if (game.player_free_turn) {
return;
}

if (magic_spell.mana_required > py.misc.current_mana) {
printMessage("You faint from the effort!");

Expand Down

0 comments on commit d9e3fef

Please sign in to comment.