summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-08-15 07:32:01 +0000
committerGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-08-15 07:32:01 +0000
commitd5a67c771f3da87ee22cbb02ebe2985e6df1f5b7 (patch)
tree362edc902d470ea25623e3af63ad2e1e90c8ec70
parent99548fb47fee447b5f22d5338501ac574086c4fd (diff)
downloadmanaserv-d5a67c771f3da87ee22cbb02ebe2985e6df1f5b7.tar.gz
manaserv-d5a67c771f3da87ee22cbb02ebe2985e6df1f5b7.tar.bz2
manaserv-d5a67c771f3da87ee22cbb02ebe2985e6df1f5b7.tar.xz
manaserv-d5a67c771f3da87ee22cbb02ebe2985e6df1f5b7.zip
Marked internal variables of Lua scripts as local.
-rw-r--r--data/scripts/libtmw.lua10
-rw-r--r--src/game-server/testing.cpp6
2 files changed, 8 insertions, 8 deletions
diff --git a/data/scripts/libtmw.lua b/data/scripts/libtmw.lua
index c4a14b6f..441ec26f 100644
--- a/data/scripts/libtmw.lua
+++ b/data/scripts/libtmw.lua
@@ -2,6 +2,11 @@
-- Support code --
------------------
+local npcs = {}
+local states = {}
+local init_fun = {}
+local timer
+
function create_npc(id, x, y, handler)
local npc = tmw.obj_create_npc(id, x, y)
npcs[npc] = handler
@@ -104,8 +109,3 @@ function initialize()
end
init_fun = nil
end
-
-npcs = {}
-states = {}
-init_fun = {}
-
diff --git a/src/game-server/testing.cpp b/src/game-server/testing.cpp
index 4f57631a..cbff6146 100644
--- a/src/game-server/testing.cpp
+++ b/src/game-server/testing.cpp
@@ -23,11 +23,11 @@ static void dropItem(MapComposite *map, int x, int y, int type)
}
static char const *npc1 =
- "npc2_times = 1\n"
+ "local nb_times = 1\n"
"function npc_handler(npc, ch)\n"
" do_message(npc, ch, \"You know what?\")\n"
- " do_message(npc, ch, string.format(\"I have already asked this question %d times today.\", npc2_times))\n"
- " npc2_times = npc2_times + 1\n"
+ " do_message(npc, ch, string.format(\"I have already asked this question %d times today.\", nb_times))\n"
+ " nb_times = nb_times + 1\n"
"end\n";
static char const *npc2 =