aboutsummaryrefslogtreecommitdiff
path: root/src/state.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/state.cpp')
-rw-r--r--src/state.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/state.cpp b/src/state.cpp
index 688ac2a..f53d180 100644
--- a/src/state.cpp
+++ b/src/state.cpp
@@ -203,14 +203,14 @@ static void copy_one_time_settings( Universe* U, lua_State* L, lua_State* L2)
203 DEBUGSPEW_CODE( fprintf( stderr, INDENT_BEGIN "copy_one_time_settings()\n" INDENT_END)); 203 DEBUGSPEW_CODE( fprintf( stderr, INDENT_BEGIN "copy_one_time_settings()\n" INDENT_END));
204 DEBUGSPEW_CODE( ++ U->debugspew_indent_depth); 204 DEBUGSPEW_CODE( ++ U->debugspew_indent_depth);
205 205
206 REGISTRY_GET( L, CONFIG_REGKEY); // config 206 CONFIG_REGKEY.query_registry(L); // config
207 // copy settings from from source to destination registry 207 // copy settings from from source to destination registry
208 if( luaG_inter_move( U, L, L2, 1, eLM_LaneBody) < 0) // // config 208 if( luaG_inter_move( U, L, L2, 1, eLM_LaneBody) < 0) // // config
209 { 209 {
210 (void) luaL_error( L, "failed to copy settings when loading lanes.core"); 210 (void) luaL_error( L, "failed to copy settings when loading lanes.core");
211 } 211 }
212 // set L2:_R[CONFIG_REGKEY] = settings 212 // set L2:_R[CONFIG_REGKEY] = settings
213 REGISTRY_SET( L2, CONFIG_REGKEY, lua_insert( L2, -2)); // 213 CONFIG_REGKEY.set_registry(L2, [](lua_State* L) { lua_insert(L, -2); }); // config
214 STACK_END( L2, 0); 214 STACK_END( L2, 0);
215 STACK_END( L, 0); 215 STACK_END( L, 0);
216 DEBUGSPEW_CODE( -- U->debugspew_indent_depth); 216 DEBUGSPEW_CODE( -- U->debugspew_indent_depth);
@@ -297,7 +297,7 @@ void call_on_state_create( Universe* U, lua_State* L, lua_State* from_, LookupMo
297 // this doesn't count as an error though 297 // this doesn't count as an error though
298 return; 298 return;
299 } 299 }
300 REGISTRY_GET( L, CONFIG_REGKEY); // {} 300 CONFIG_REGKEY.query_registry(L); // {}
301 STACK_MID( L, 1); 301 STACK_MID( L, 1);
302 lua_getfield( L, -1, "on_state_create"); // {} on_state_create() 302 lua_getfield( L, -1, "on_state_create"); // {} on_state_create()
303 lua_remove( L, -2); // on_state_create() 303 lua_remove( L, -2); // on_state_create()
@@ -338,7 +338,7 @@ lua_State* luaG_newstate( Universe* U, lua_State* from_, char const* libs_)
338 STACK_MID( L, 0); 338 STACK_MID( L, 0);
339 339
340 // we'll need this every time we transfer some C function from/to this state 340 // we'll need this every time we transfer some C function from/to this state
341 REGISTRY_SET( L, LOOKUP_REGKEY, lua_newtable( L)); 341 LOOKUP_REGKEY.set_registry(L, [](lua_State* L) { lua_newtable(L); });
342 STACK_MID( L, 0); 342 STACK_MID( L, 0);
343 343
344 // neither libs (not even 'base') nor special init func: we are done 344 // neither libs (not even 'base') nor special init func: we are done