Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void ssuge::ScriptManager::executeScriptMethod(std::string fileName, std::string methodName, std::string goName, std::string groupName)
- {
- //Stack as expected [...]
- lua_getglobal(mLua, groupName.c_str());// [..., groupTable]
- lua_getglobal(mLua, fileName.c_str());// [..., groupTable, script_module]
- lua_getfield(mLua, -1, methodName.c_str());// [..., groupTable, script_module, method]
- lua_getfield(mLua, -3, goName.c_str());// [..., groupTable, script_module, method, inst]
- lua_pcall(mLua, 1, 0, 0);
- if (lua_isstring(mLua, -1))
- {
- std::string errMsg = lua_tostring(mLua, -1);
- std::cout << "Error in running method:" << methodName << " in " << fileName << std::endl;
- std::cout << errMsg << std::endl;
- LOG_MANAGER->log(errMsg, LL_ERROR);
- stackDump_log(mLua);
- dumpCallStack_log(mLua);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement