MCPcopy Create free account
hub / github.com/defold/defold / GetScriptWorldContextValue

Function GetScriptWorldContextValue

engine/script/src/script.cpp:1151–1172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1149 }
1150
1151 void GetScriptWorldContextValue(HScriptWorld script_world)
1152 {
1153 lua_State* L = script_world->m_Context->m_LuaState;
1154 lua_rawgeti(L, LUA_REGISTRYINDEX, script_world->m_WorldContextTableRef);
1155 // [-2] key
1156 // [-1] context table
1157
1158 lua_insert(L, -2);
1159 // [-2] context table
1160 // [-1] key
1161
1162 lua_gettable(L, -2);
1163 // [-2] context table
1164 // [-1] value
1165
1166 lua_insert(L, -2);
1167 // [-2] value
1168 // [-1] context table
1169
1170 lua_pop(L, 1);
1171 // [-1] value
1172 }
1173
1174 uint32_t GenerateUniqueScriptId()
1175 {

Calls 3

lua_rawgetiFunction · 0.85
lua_insertFunction · 0.85
lua_gettableFunction · 0.85