From 646fb10397e440ab67fb5a678bf034c53b050109 Mon Sep 17 00:00:00 2001 From: Erik Schilling Date: Fri, 23 Dec 2011 23:46:05 +0800 Subject: Made do_npc_close to be called by default after the end of the talk function Reviewed-by: Bertram. --- scripts/lua/libmana.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/lua/libmana.lua b/scripts/lua/libmana.lua index f9f2857..d0d8666 100644 --- a/scripts/lua/libmana.lua +++ b/scripts/lua/libmana.lua @@ -42,7 +42,12 @@ local timer -- Note: Cannot be called until map initialization has started. function create_npc(name, id, x, y, talkfunct, updatefunct) local npc = mana.npc_create(name, id, x, y) - if talkfunct then npc_talk_functs[npc] = talkfunct end + if talkfunct then + npc_talk_functs[npc] = function(npc, ch) + talkfunct(npc, ch) + do_npc_close(npc, ch) + end + end if updatefunct then npc_update_functs[npc] = updatefunct end return npc end -- cgit