summaryrefslogtreecommitdiff
path: root/src/scripting/script.cpp
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2010-08-22 13:32:24 +0200
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2010-08-22 13:39:39 +0200
commit9ea18abb49a760fe1eda197c02cbdcd680b47204 (patch)
treef3b8a8a3e65dc313cc1a5503bc1ee473a199204d /src/scripting/script.cpp
parentbfca89de4edded82668376d2388784defbee071b (diff)
downloadmanaserv-9ea18abb49a760fe1eda197c02cbdcd680b47204.tar.gz
manaserv-9ea18abb49a760fe1eda197c02cbdcd680b47204.tar.bz2
manaserv-9ea18abb49a760fe1eda197c02cbdcd680b47204.tar.xz
manaserv-9ea18abb49a760fe1eda197c02cbdcd680b47204.zip
Pass a script name to Lua for proper reporting of error locations
Now the Lua file name shows up in the error message and stack traceback, or the map file and object name in case of a script embedded in a map file.
Diffstat (limited to 'src/scripting/script.cpp')
-rw-r--r--src/scripting/script.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/scripting/script.cpp b/src/scripting/script.cpp
index 3d16a7d1..334895c3 100644
--- a/src/scripting/script.cpp
+++ b/src/scripting/script.cpp
@@ -88,7 +88,7 @@ bool Script::loadFile(const std::string &name)
if (buffer)
{
mScriptFile = name;
- load(skipPotentialBom(buffer));
+ load(skipPotentialBom(buffer), name.c_str());
free(buffer);
return true;
} else {
@@ -99,7 +99,7 @@ bool Script::loadFile(const std::string &name)
void Script::loadNPC(const std::string &name, int id, int x, int y,
const char *prog)
{
- load(prog);
+ load(prog, name.c_str());
prepare("create_npc_delayed");
push(name);
push(id);