diff options
author | Adam Borowski <kilobyte@angband.pl> | 2010-12-18 12:42:31 +0100 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2010-12-18 12:42:31 +0100 |
commit | e5001fba77867a842c1b0b192ec6969aab1cf102 (patch) | |
tree | 86b74c45731064f6f3840c172508d77842b1788b /crawl-ref/source/clua.cc | |
parent | d562ab002f5aad0a15d8e94830aa710f78c52513 (diff) | |
download | crawl-ref-e5001fba77867a842c1b0b192ec6969aab1cf102.tar.gz crawl-ref-e5001fba77867a842c1b0b192ec6969aab1cf102.zip |
Stop lua from adding [string "%s"] to error messages. (greensnark)
Diffstat (limited to 'crawl-ref/source/clua.cc')
-rw-r--r-- | crawl-ref/source/clua.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crawl-ref/source/clua.cc b/crawl-ref/source/clua.cc index e458df341f..300d4095c2 100644 --- a/crawl-ref/source/clua.cc +++ b/crawl-ref/source/clua.cc @@ -256,7 +256,9 @@ int CLua::loadfile(lua_State *ls, const char *filename, bool trusted, while (!f.eof()) script += f.get_line() + "\n"; - return luaL_loadbuffer(ls, &script[0], script.length(), file.c_str()); + // prefixing with @ stops lua from adding [string "%s"] + return luaL_loadbuffer(ls, &script[0], script.length(), + ("@" + file).c_str()); } int CLua::execfile(const char *filename, bool trusted, bool die_on_fail, |