diff options
author | Robert Vollmert <rvollmert@gmx.net> | 2009-11-03 11:59:53 +0100 |
---|---|---|
committer | Robert Vollmert <rvollmert@gmx.net> | 2009-11-03 12:01:50 +0100 |
commit | c3ef566864421728eaafd453ce5b0a524457d641 (patch) | |
tree | e94e9eab2d7affaa95bba3c709219b64f03f8a4a /crawl-ref/source/luaterp.cc | |
parent | 095295bd6f6053fb1ad8e719ed78c942deccab0d (diff) | |
download | crawl-ref-c3ef566864421728eaafd453ce5b0a524457d641.tar.gz crawl-ref-c3ef566864421728eaafd453ce5b0a524457d641.zip |
Improve error handling in lua interpreter.
lua_pcall is now passing 0 for errfunc so the plain error message
comes out. Also, remove the call to lua_gc on error since that
was causing further errors.
This is probably not the right way to do things but hopefully an
improvement for now.
Diffstat (limited to 'crawl-ref/source/luaterp.cc')
-rw-r--r-- | crawl-ref/source/luaterp.cc | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/crawl-ref/source/luaterp.cc b/crawl-ref/source/luaterp.cc index 8fb68448ec..1ef18db9c8 100644 --- a/crawl-ref/source/luaterp.cc +++ b/crawl-ref/source/luaterp.cc @@ -86,10 +86,7 @@ static int _loadline(lua_State *ls) static int _docall(lua_State *ls) { int status; - int base = lua_gettop(ls); - status = lua_pcall(ls, 0, LUA_MULTRET, base); - if (status != 0) - lua_gc(ls, LUA_GCCOLLECT, 0); + status = lua_pcall(ls, 0, LUA_MULTRET, 0); return (status); } |