summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/it_use2.cc
diff options
context:
space:
mode:
authorJude Brown <bookofjude@users.sourceforge.net>2010-01-02 17:02:30 +1000
committerJude Brown <bookofjude@users.sourceforge.net>2010-01-02 17:06:11 +1000
commitcc5602c5e88b63d1db30bcdc34bee791768c5666 (patch)
tree4c18efebf7d98a3fa70bf8755337ae552a66c386 /crawl-ref/source/it_use2.cc
parent2bd7c49b579df905f1fe4d880051716d6649aaf8 (diff)
downloadcrawl-ref-cc5602c5e88b63d1db30bcdc34bee791768c5666.tar.gz
crawl-ref-cc5602c5e88b63d1db30bcdc34bee791768c5666.zip
Fix MP+X property in unrands (Mantis #294, Vandal).
calc_mp() only seemed to be called when games are loaded, meaning that putting on the unrand Hat of Pondering did not cause the player's max MP to immediately increase. Saving and reloading fixed this. The same happened with removing the hat: the player's max MP stays at the same value as when the hat was worn. Saving and reloading also fixed this. Fixed this by calling calc_mp(), and also cleaned up the code slightly. It still doesn't seem to be printing the "Your magic increases/decreases" messages, however.
Diffstat (limited to 'crawl-ref/source/it_use2.cc')
-rw-r--r--crawl-ref/source/it_use2.cc13
1 files changed, 6 insertions, 7 deletions
diff --git a/crawl-ref/source/it_use2.cc b/crawl-ref/source/it_use2.cc
index ccca70a29d..1588e86e84 100644
--- a/crawl-ref/source/it_use2.cc
+++ b/crawl-ref/source/it_use2.cc
@@ -719,14 +719,10 @@ void unuse_artefact(const item_def &item, bool *show_msgs)
}
}
- if (proprt[ARTP_MAGICAL_POWER])
+ if (proprt[ARTP_MAGICAL_POWER] && !known[ARTP_MAGICAL_POWER])
{
- you.redraw_magic_points = true;
- if (!known[ARTP_MAGICAL_POWER])
- {
- mprf("You feel your mana capacity %s.",
- proprt[ARTP_MAGICAL_POWER] > 0 ? "decrease" : "increase");
- }
+ mprf("You feel your mana capacity %s.",
+ proprt[ARTP_MAGICAL_POWER] > 0 ? "decrease" : "increase");
}
// Modify ability scores; always output messages.
@@ -750,6 +746,9 @@ void unuse_artefact(const item_def &item, bool *show_msgs)
if (proprt[ARTP_INVISIBLE] != 0 && you.duration[DUR_INVIS] > 1)
you.duration[DUR_INVIS] = 1;
+ if (proprt[ARTP_MAGICAL_POWER])
+ calc_mp();
+
if (is_unrandom_artefact(item))
{
const unrandart_entry *entry = get_unrand_entry(item.special);