MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / function_object

Method function_object

ogsr_engine/COMMON_AI/script_engine.cpp:289–313  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

287}
288
289bool 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
315void CScriptEngine::collect_all_garbage()
316{

Callers 1

register_script_classMethod · 0.80

Calls 3

objectMethod · 0.95
name_spaceMethod · 0.95
xr_strcmpFunction · 0.50

Tested by

no test coverage detected