[Add] Check for errors when using "include".
This commit is contained in:
parent
05fe285d87
commit
203079bcfa
@ -83,7 +83,8 @@ lua_State* llua_newState(void) {
|
|||||||
/* Open a lua library. */
|
/* Open a lua library. */
|
||||||
int llua_load(lua_State* L, lua_CFunction f) {
|
int llua_load(lua_State* L, lua_CFunction f) {
|
||||||
lua_pushcfunction(L, f);
|
lua_pushcfunction(L, f);
|
||||||
lua_pcall(L, 0, 0, 0);
|
if(lua_pcall(L, 0, 0, 0))
|
||||||
|
WARN("llua include error: %s", lua_tostring(L, -1));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user