bool CScriptEngine::function_object(LPCSTR function_to_call, luabind::object &object, int type) { if (!xr_strlen(function_to_call)) return (false); string256 name_space, function; parse_script_namespace(function_to_call, name_space, sizeof(name_space), function, sizeof(function)); if (xr_strcmp(name_space, "_G")) { LPSTR file_name = strchr(name_space, '.'); if (!file_name) process_file(name_space); else { *file_name = 0; process_file(name_space); *file_name = '.'; } } if (!this->object(name_space, function, type)) return (false); luabind::object lua_namespace = this->name_space(name_space); object = lua_namespace[function]; return (true); }
bool CScriptEngine::function_object(LPCSTR function_to_call, luabind::object &object, int type) { if (!xr_strlen(function_to_call)) return (false); string256 name_space, function; parse_script_namespace (function_to_call,name_space,function); if (xr_strcmp(name_space,"_G")) process_file (name_space); if (!this->object(name_space,function,type)) return (false); luabind::object lua_namespace = this->name_space(name_space); object = lua_namespace[function]; return (true); }