summaryrefslogtreecommitdiff
path: root/src/dungeon.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dungeon.c')
-rw-r--r--src/dungeon.c26
1 files changed, 3 insertions, 23 deletions
diff --git a/src/dungeon.c b/src/dungeon.c
index e60f1ef0..342779b2 100644
--- a/src/dungeon.c
+++ b/src/dungeon.c
@@ -801,30 +801,10 @@ bool_ decays(object_type *o_ptr)
static int process_lasting_spell(s16b music)
{
- int oldtop, use_mana;
+ spell_type *spell = spell_at(-music);
- if (music > 0) return FALSE;
-
- oldtop = lua_gettop(L);
-
- music = -music;
-
- /* Push the function */
- lua_getglobal(L, "exec_lasting_spell");
-
- /* Push the spell */
- tolua_pushnumber(L, music);
-
- /* Call the function */
- if (lua_call(L, 1, 1))
- {
- cmsg_format(TERM_VIOLET, "ERROR in lua_call while calling lasting spell");
- return 0;
- }
-
- use_mana = tolua_getnumber(L, -(lua_gettop(L) - oldtop), 0);
- lua_settop(L, oldtop);
- return use_mana;
+ assert(spell->lasting_func != NULL);
+ return spell->lasting_func();
}
static void gere_class_special()