@@ -209,22 +209,6 @@ void CScriptEngine::OpenLuaDelayed ()
209
209
// unless they explicitly enable it, remove ability to load DLLs
210
210
DisableDLLs (L);
211
211
212
- m_pDoc->m_iCurrentActionSource = eLuaSandbox;
213
-
214
- // preliminary sand-box stuff
215
- ParseLua (App.m_strLuaScript , " Sandbox" );
216
-
217
- // this is so useful I am adding it in (see check.lua)
218
- ParseLua ( \
219
- " function check (result) \
220
- if result ~= error_code.eOK then\
221
- error (error_desc [result] or \
222
- string.format (\" Unknown error code: %i\" , result), 2) end; end" ,
223
- " Check function" );
224
-
225
- m_pDoc->m_iCurrentActionSource = eUnknownActionSource;
226
-
227
-
228
212
// add luacom to package.preload
229
213
lua_getglobal (L, LUA_LOADLIBNAME); // package table
230
214
@@ -243,6 +227,20 @@ void CScriptEngine::OpenLuaDelayed ()
243
227
244
228
lua_pop (L, 1 ); // get rid of package table from stack
245
229
230
+ // this is so useful I am adding it in (see check.lua)
231
+ ParseLua ( \
232
+ " function check (result) \
233
+ if result ~= error_code.eOK then\
234
+ error (error_desc [result] or \
235
+ string.format (\" Unknown error code: %i\" , result), 2) end; end" ,
236
+ " Check function" );
237
+
238
+ // preliminary sand-box stuff
239
+ m_pDoc->m_iCurrentActionSource = eLuaSandbox;
240
+ ParseLua (App.m_strLuaScript , " Sandbox" );
241
+
242
+ m_pDoc->m_iCurrentActionSource = eUnknownActionSource;
243
+
246
244
lua_settop (L, 0 ); // clear stack
247
245
248
246
} // end of OpenLuaDelayed
0 commit comments