summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/item_use.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/item_use.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/item_use.cc')
-rw-r--r--crawl-ref/source/item_use.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index cf13353bb6..9cd2d4fd2b 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -5630,15 +5630,11 @@ void use_artefact(item_def &item, bool *show_msgs, bool unmeld)
}
}
- 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? "increase" : "decrease");
- artefact_wpn_learn_prop(item, ARTP_MAGICAL_POWER);
- }
+ mprf("You feel your mana capacity %s.",
+ proprt[ARTP_MAGICAL_POWER] > 0? "increase" : "decrease");
+ artefact_wpn_learn_prop(item, ARTP_MAGICAL_POWER);
}
// Modify ability scores.
@@ -5699,6 +5695,10 @@ void use_artefact(item_def &item, bool *show_msgs, bool unmeld)
// there is a dangerous monster nearby...
xom_is_stimulated(128);
}
+
+ // Let's try this here instead of up there.
+ if (proprt[ARTP_MAGICAL_POWER])
+ calc_mp();
#undef unknown_proprt
}