@@ -226,22 +226,22 @@ void CScriptEngine::OpenLuaDelayed ()
226
226
227
227
228
228
// add luacom to package.preload
229
- lua_getglobal (L, LUA_LOADLIBNAME); /* " package" */
229
+ lua_getglobal (L, LUA_LOADLIBNAME); // package table
230
230
231
- if (lua_istable (L, -1 ))
231
+ if (lua_istable (L, -1 )) // if it exists and is a table
232
232
{
233
- lua_getfield (L, -1 , " preload" );
233
+ lua_getfield (L, -1 , " preload" ); // get preload table inside it
234
234
235
- if (lua_istable (L, -1 ))
235
+ if (lua_istable (L, -1 )) // preload table exists
236
236
{
237
- lua_pushcfunction (L, luacom_open_glue);
238
- lua_setfield (L, -2 , " luacom" );
239
- lua_pop (L, 1 ); // get rid of preload table from stack
237
+ lua_pushcfunction (L, luacom_open_glue); // luacom open
238
+ lua_setfield (L, -2 , " luacom" );
240
239
} // have package.preload table
241
240
242
- lua_pop (L, 1 ); // get rid of package table from stack
241
+ lua_pop (L, 1 ); // get rid of preload table from stack
243
242
} // have package table
244
243
244
+ lua_pop (L, 1 ); // get rid of package table from stack
245
245
246
246
lua_settop (L, 0 ); // clear stack
247
247
0 commit comments