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

Function Run

source/lib/Scripts/src/Scripts.cpp:149–181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147}
148
149ScriptError Run()
150{
151 lua_init();
152
153 int err = lua_pcall(g_lua_state, 0, LUA_MULTRET, 0);
154
155 // int top = lua_gettop(g_lua_state);
156
157 if (err != LUA_OK)
158 {
159 // script_dbg_dump_stack("");
160
161 ScriptVar s = ScriptVar::ReadVar(-1, false);
162
163 SetErrMsg(s.ToString());
164
165 lua_pop(g_lua_state, 1);
166 }
167
168 // EXIT_IF(lua_gettop(g_lua_state));
169
170 if (err == LUA_ERRRUN)
171 {
172 return ScriptError::RunError;
173 }
174
175 if (err != LUA_OK)
176 {
177 return ScriptError::UnknownError;
178 }
179
180 return ScriptError::Ok;
181}
182
183ScriptError RunFile(const String& file_name)
184{

Callers 4

SDL_WinRTInitNonXAMLAppFunction · 0.85
RunMethod · 0.85
RunFileFunction · 0.85
RunStringFunction · 0.85

Calls 3

lua_initFunction · 0.85
SetErrMsgFunction · 0.85
ToStringMethod · 0.45

Tested by

no test coverage detected