MCPcopy Create free account
hub / github.com/InoriRus/Kyty / KYTY_STATIC_SCRIPT_FUNC

Function KYTY_STATIC_SCRIPT_FUNC

source/lib/Scripts/src/ScriptsFileLib.cpp:26–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24}
25
26KYTY_STATIC_SCRIPT_FUNC(dofile)
27{
28 KYTY_SCRIPT_FUNC_BEGIN();
29
30 if (Scripts::ArgGetVarCount() != 1)
31 {
32 KYTY_SCRIPT_THROW_ERROR(U"invalid args\n");
33 }
34
35 String file_name = Scripts::ArgGetVar(0).ToString();
36
37 ScriptError err = RunFile(file_name);
38
39 if (err != ScriptError::Ok)
40 {
41 KYTY_SCRIPT_THROW_ERROR(create_error(err, U"can't run file", file_name));
42 }
43
44 return Scripts::ArgGetVarCount() - 1;
45}
46
47KYTY_STATIC_SCRIPT_FUNC(require)
48{

Callers

nothing calls this directly

Calls 15

ArgGetVarCountFunction · 0.85
ArgGetVarFunction · 0.85
RunFileFunction · 0.85
create_errorFunction · 0.85
lua_getfieldFunction · 0.85
lua_tobooleanFunction · 0.85
RunStringFunction · 0.85
lua_gettopFunction · 0.85
lua_pushnilFunction · 0.85
lua_setfieldFunction · 0.85
lua_pushbooleanFunction · 0.85
lua_pushvalueFunction · 0.85

Tested by

no test coverage detected