diff --git a/apps/twnlua/game.c b/apps/twnlua/game.c index 0fd7330..f578a39 100644 --- a/apps/twnlua/game.c +++ b/apps/twnlua/game.c @@ -47,10 +47,13 @@ static int physfs_loader(lua_State *L) { free(final_path); /* TODO: use reader interface for streaming instead */ - int const result = luaL_loadbuffer(L, (char *)buf, buf_size, name) == LUA_OK; + int const result = luaL_loadbuffer(L, (char *)buf, buf_size, name); free(buf); - return result; + if (result != LUA_OK) + log_critical("%s", lua_tostring(L, -1)); + + return result == LUA_OK; }