Tune caves
[oweals/minetest.git] / src / script.cpp
index 14c23e009f7728b380a4fa838281d627018f3f50..a159f2288e044ebc5ca387dd491cb0af95c5d395 100644 (file)
@@ -89,20 +89,25 @@ int luaErrorHandler(lua_State *L) {
 
 bool script_load(lua_State *L, const char *path)
 {
-       infostream<<"Loading and running script from "<<path<<std::endl;
+       verbosestream<<"Loading and running script from "<<path<<std::endl;
 
        lua_pushcfunction(L, luaErrorHandler);
        int errorhandler = lua_gettop(L);
 
        int ret = luaL_loadfile(L, path) || lua_pcall(L, 0, 0, errorhandler);
        if(ret){
-               errorstream<<"Failed to load and run script from "<<path<<":"<<std::endl;
-               errorstream<<"[LUA] "<<std::endl;
-               errorstream<<"[LUA] "<<lua_tostring(L, -1)<<std::endl;
-               errorstream<<"[LUA] "<<std::endl;
+               errorstream<<"========== ERROR FROM LUA ==========="<<std::endl;
+               errorstream<<"Failed to load and run script from "<<std::endl;
+               errorstream<<path<<":"<<std::endl;
+               errorstream<<std::endl;
+               errorstream<<lua_tostring(L, -1)<<std::endl;
+               errorstream<<std::endl;
+               errorstream<<"=======END OF ERROR FROM LUA ========"<<std::endl;
                lua_pop(L, 1); // Pop error message from stack
+               lua_pop(L, 1); // Pop the error handler from stack
                return false;
        }
+       lua_pop(L, 1); // Pop the error handler from stack
        return true;
 }