summaryrefslogtreecommitdiff
path: root/src/object1.cc
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2015-02-23 09:11:55 +0100
committerBardur Arantsson <bardur@scientician.net>2015-02-23 09:11:55 +0100
commit692699f064b2d792b61a5aa448b6844e8c713248 (patch)
tree9e25e80c55c3e2fea86de4d7ccfd037fe64aabc4 /src/object1.cc
parente63216657a9a2711483517e8eb5bed46215ae6dd (diff)
Change spell_chance_device parameter to use spell_type pointer
There's no need to go through the extra indirection of the spell list.
Diffstat (limited to 'src/object1.cc')
-rw-r--r--src/object1.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/object1.cc b/src/object1.cc
index e3f29bd3..96f01517 100644
--- a/src/object1.cc
+++ b/src/object1.cc
@@ -2713,8 +2713,11 @@ void describe_device(object_type *o_ptr)
/* Enter device mode */
set_stick_mode(o_ptr);
+ // Spell reference
+ auto spell = spell_at(o_ptr->pval2);
+
text_out("\nSpell description:\n");
- spell_type_description_foreach(spell_at(o_ptr->pval2),
+ spell_type_description_foreach(spell,
[] (std::string const &text) -> void {
text_out("\n");
text_out(text.c_str());
@@ -2725,14 +2728,14 @@ void describe_device(object_type *o_ptr)
text_out_c(TERM_L_BLUE, buf);
text_out("\nMinimum Magic Device level to increase spell level: ");
- text_out_c(TERM_L_BLUE, format("%d", spell_type_skill_level(spell_at(o_ptr->pval2))));
+ text_out_c(TERM_L_BLUE, format("%d", spell_type_skill_level(spell)));
text_out("\nSpell fail: ");
- sprintf(buf, FMTs32b, spell_chance_device(o_ptr->pval2));
+ sprintf(buf, FMTs32b, spell_chance_device(spell));
text_out_c(TERM_GREEN, buf);
text_out("\nSpell info: ");
- text_out_c(TERM_YELLOW, spell_type_info(spell_at(o_ptr->pval2)));
+ text_out_c(TERM_YELLOW, spell_type_info(spell));
/* Leave device mode */
unset_stick_mode();