|
@@ -4002,8 +4002,10 @@ void tnsLuaRunNode(lua_State* L, tnsEvaluatedNode* en, char* func, tnsObject* ro
|
|
|
if(!(rp->UseScript&&rp->Script&&rp->Script->Ptr)){ continue; }
|
|
|
char* debug_name=rp->Name&&rp->Name->Ptr?rp->Name->Ptr:"unamed_driver_page";
|
|
|
lua_pushinteger(L,lua_objlen(L,-1)+1);
|
|
|
- if(!luaL_loadbuffer(L,rp->Script->Ptr,strlen(rp->Script->Ptr),debug_name)){ lua_call(L,0,1); lua_settable(L,-3); }
|
|
|
- else{ lua_pop(L,2); /* pop error and index */ }
|
|
|
+ if(!luaL_loadbuffer(L,rp->Script->Ptr,strlen(rp->Script->Ptr),debug_name)){
|
|
|
+ if(lua_pcall(L,0,1,0)){ lua_getglobal(L,"log"); lua_insert(L,-2); if(lua_pcall(L,1,0,0)){ lua_pop(L,1); } }
|
|
|
+ else{ lua_settable(L,-3); }
|
|
|
+ }else{ lua_getglobal(L,"log"); lua_insert(L,-2); if(lua_pcall(L,1,0,0)){ lua_pop(L,1); } lua_pop(L,1); /* pop index */ }
|
|
|
}
|
|
|
root->LuaCacheID=en->LuaID;
|
|
|
}
|
|
@@ -4015,7 +4017,7 @@ void tnsLuaRunNode(lua_State* L, tnsEvaluatedNode* en, char* func, tnsObject* ro
|
|
|
|
|
|
lua_pushnil(L); while(lua_next(L,-2)){
|
|
|
lua_getfield(L,-1,func); if((!lua_isnil(L,-1))&&lua_isfunction(L,-1)){
|
|
|
- lua_pushvalue(L,-2); lua_call(L,1,0);
|
|
|
+ lua_pushvalue(L,-2); if(lua_pcall(L,1,0,0)){ lua_getglobal(L,"log"); lua_insert(L,-2); if(lua_pcall(L,1,0,0)){ lua_pop(L,1); } }
|
|
|
}
|
|
|
lua_pop(L,1);
|
|
|
}
|