From a9ba502b2856b4125ffc99cafee429c00a7ea958 Mon Sep 17 00:00:00 2001 From: Roderic Morris Date: Tue, 21 Oct 2008 22:26:05 +0000 Subject: return npc ids when creating new ones (by Kage_Jittai) --- data/scripts/libs/libtmw.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'data/scripts/libs') diff --git a/data/scripts/libs/libtmw.lua b/data/scripts/libs/libtmw.lua index 5b1792f..0bb7292 100644 --- a/data/scripts/libs/libtmw.lua +++ b/data/scripts/libs/libtmw.lua @@ -62,6 +62,7 @@ function create_npc(name, id, x, y, talkfunct, updatefunct) local npc = tmw.npc_create(name, id, x, y) if talkfunct then npc_talk_functs[npc] = talkfunct end if updatefunct then npc_update_functs[npc] = updatefunct end + return npc end -- Waits for the player to acknowledge the previous message, if any. @@ -222,7 +223,7 @@ end function update() -- check the scheduler check_schedule() - + -- Run every minute only, in order not to overload the server. if not timer then return end timer = timer - 1 @@ -335,7 +336,7 @@ function on_death(being, funct) tmw.note_on_death(being) end --- called by the engine when a being with dies for which a death +-- called by the engine when a being with dies for which a death -- notification has been requested function death_notification(being) if type(ondeath_functs[being]) == "table" then @@ -355,4 +356,4 @@ end tmw.chr_money = function(ch) return tmw.chr_inv_count(ch, 0) -end \ No newline at end of file +end -- cgit