1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

random scripting work-in-progress

This commit is contained in:
Perttu Ahola 2011-11-11 20:50:09 +02:00
parent f8430723e0
commit a6a1e6ed1a
7 changed files with 55 additions and 24 deletions

View file

@ -108,7 +108,8 @@ bool script_load(lua_State *L, const char *path)
infostream<<"Loading and running script from "<<path<<std::endl;
int ret = luaL_loadfile(L, path) || lua_pcall(L, 0, 0, 0);
if(ret){
errorstream<<"Failed to load and run script from "<<path<<": "<<lua_tostring(L, -1)<<std::endl;
errorstream<<"Failed to load and run script from "<<path<<":"<<std::endl;
errorstream<<"[LUA] "<<lua_tostring(L, -1)<<std::endl;
lua_pop(L, 1); // Pop error message from stack
return false;
}