summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoderic Morris <roderic@ccs.neu.edu>2008-10-21 22:26:05 +0000
committerRoderic Morris <roderic@ccs.neu.edu>2008-10-21 22:26:05 +0000
commita9ba502b2856b4125ffc99cafee429c00a7ea958 (patch)
treefac8e12eb31601d44aa8609b2e26c752445a68ba
parent8eefca6ea575d6b55a0ad493ce7f7aa3f9c88f5e (diff)
downloadmanaserv-a9ba502b2856b4125ffc99cafee429c00a7ea958.tar.gz
manaserv-a9ba502b2856b4125ffc99cafee429c00a7ea958.tar.bz2
manaserv-a9ba502b2856b4125ffc99cafee429c00a7ea958.tar.xz
manaserv-a9ba502b2856b4125ffc99cafee429c00a7ea958.zip
return npc ids when creating new ones (by Kage_Jittai)
-rw-r--r--ChangeLog5
-rw-r--r--data/scripts/libs/libtmw.lua7
2 files changed, 9 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 6c94efdc..e9ed6fef 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2008-10-21 Roderic Morris <roderic@ccs.neu.edu>
+ * data/scripts/libs/libtmw.lua: patch by Kage_Jittai to have
+ npc ids returned when creating new npcs.
+
+2008-10-21 Roderic Morris <roderic@ccs.neu.edu>
+
* src/scripting/lua.cpp, data/test.lua, data/scripts/test.lua,
data/scripts/npclib.lua, data/scripts/libs, data/scripts/libs/npclib.lua,
data/scripts/libs/libtmw.lua, data/scripts/libtmw.lua:
diff --git a/data/scripts/libs/libtmw.lua b/data/scripts/libs/libtmw.lua
index 5b1792f9..0bb72923 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