summaryrefslogtreecommitdiff
path: root/src/object1.cc
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2014-12-23 11:58:47 +0100
committerBardur Arantsson <bardur@scientician.net>2014-12-23 12:07:54 +0100
commitc315b41d8fd2ee37a36eaaafec10994623392df3 (patch)
tree6f338e8ef5bcb37b8f02a6b4f6792bf54fb5712d /src/object1.cc
parent45ec003a1de7857ac7dddb0732a9d005612b886f (diff)
Rework spell_type_description_foreach to use lambdas
Diffstat (limited to 'src/object1.cc')
-rw-r--r--src/object1.cc16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/object1.cc b/src/object1.cc
index 54fa596b..6c051c67 100644
--- a/src/object1.cc
+++ b/src/object1.cc
@@ -14,6 +14,7 @@
#include "quark.h"
#include "spell_type.h"
+#include "spell_type.hpp"
#include "hooks.h"
/*
@@ -2746,15 +2747,6 @@ void display_ammo_damage(object_type *o_ptr)
}
/*
- * Output spell description
- */
-static void print_device_desc_callback(void *data, cptr text)
-{
- text_out("\n");
- text_out(text);
-}
-
-/*
* Describe a magic stick powers
*/
void describe_device(object_type *o_ptr)
@@ -2769,8 +2761,10 @@ void describe_device(object_type *o_ptr)
text_out("\nSpell description:\n");
spell_type_description_foreach(spell_at(o_ptr->pval2),
- print_device_desc_callback,
- NULL);
+ [] (std::string const &text) -> void {
+ text_out("\n");
+ text_out(text.c_str());
+ });
text_out("\nSpell level: ");
sprintf(buf, FMTs32b, get_level(o_ptr->pval2, 50, 0));