summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorErik Schilling <ablu.erikschilling@googlemail.com>2011-12-23 23:46:05 +0800
committerErik Schilling <ablu.erikschilling@googlemail.com>2012-01-02 19:59:31 +0800
commit646fb10397e440ab67fb5a678bf034c53b050109 (patch)
treee0e949556849ed33ca43a2908099c183a0309d31 /scripts
parentb7284a90a6bc4275c2c6acc316758bc838fe29d2 (diff)
downloadmanaserv-646fb10397e440ab67fb5a678bf034c53b050109.tar.gz
manaserv-646fb10397e440ab67fb5a678bf034c53b050109.tar.bz2
manaserv-646fb10397e440ab67fb5a678bf034c53b050109.tar.xz
manaserv-646fb10397e440ab67fb5a678bf034c53b050109.zip
Made do_npc_close to be called by default after the end of the talk function
Reviewed-by: Bertram.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lua/libmana.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/lua/libmana.lua b/scripts/lua/libmana.lua
index f9f28575..d0d8666f 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