summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2012-05-17 08:40:49 +0200
committerBardur Arantsson <bardur@scientician.net>2012-05-18 11:47:20 +0200
commit159e8b3ec190d6a99c3d42e78dc2c55bdd0f6f41 (patch)
treed62350d07472fe091aa3c7d39fbbca3649636623 /src
parentccb4ffd3033ac953c064b590709e0a88ff659003 (diff)
Lua: Separate get_spell_info() function
Diffstat (limited to 'src')
-rw-r--r--src/externs.h2
-rw-r--r--src/lua_bind.c5
-rw-r--r--src/object1.c2
3 files changed, 7 insertions, 2 deletions
diff --git a/src/externs.h b/src/externs.h
index 564c0b2b..386bd63c 100644
--- a/src/externs.h
+++ b/src/externs.h
@@ -2341,6 +2341,8 @@ extern timer_type *TIMER_AGGRAVATE_EVIL;
void timer_aggravate_evil_enable();
void timer_aggravate_evil_callback();
+cptr get_spell_info(s32b s);
+
/* skills.c */
extern void dump_skills(FILE *fff);
extern s16b find_skill(cptr name);
diff --git a/src/lua_bind.c b/src/lua_bind.c
index a019004b..11f47bca 100644
--- a/src/lua_bind.c
+++ b/src/lua_bind.c
@@ -577,4 +577,7 @@ void timer_aggravate_evil_callback()
dispel_evil(0);
}
-
+cptr get_spell_info(s32b s)
+{
+ return string_exec_lua(format("return __spell_info[" FMTs32b "]()", s));
+}
diff --git a/src/object1.c b/src/object1.c
index b834eb91..3b418651 100644
--- a/src/object1.c
+++ b/src/object1.c
@@ -2847,7 +2847,7 @@ void describe_device(object_type *o_ptr)
text_out_c(TERM_GREEN, string_exec_lua(format("return tostring(spell_chance(%d))", o_ptr->pval2)));
text_out("\nSpell info: ");
- text_out_c(TERM_YELLOW, string_exec_lua(format("return __spell_info[%d]()", o_ptr->pval2)));
+ text_out_c(TERM_YELLOW, get_spell_info(o_ptr->pval2));
/* Leave device mode */
unset_stick_mode();