| 287 | } |
| 288 | |
| 289 | bool CScriptEngine::function_object(const char* function_to_call, luabind::object& object, int type) |
| 290 | { |
| 291 | if (!strlen(function_to_call)) |
| 292 | return false; |
| 293 | string256 name_space, function; |
| 294 | parse_script_namespace(function_to_call, name_space, sizeof(name_space), function, sizeof(function)); |
| 295 | if (xr_strcmp(name_space, GlobalNamespace)) |
| 296 | { |
| 297 | auto file_name = strchr(name_space, '.'); |
| 298 | if (!file_name) |
| 299 | process_file(name_space); |
| 300 | else |
| 301 | { |
| 302 | *file_name = 0; |
| 303 | process_file(name_space); |
| 304 | *file_name = '.'; |
| 305 | } |
| 306 | } |
| 307 | |
| 308 | if (!this->object(name_space, function, type)) |
| 309 | return false; |
| 310 | auto lua_namespace = this->name_space(name_space); |
| 311 | object = lua_namespace[function]; |
| 312 | return true; |
| 313 | } |
| 314 | |
| 315 | void CScriptEngine::collect_all_garbage() |
| 316 | { |
no test coverage detected