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

Function SetScriptWorldContextValue

engine/script/src/script.cpp:1132–1149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1130 }
1131
1132 void SetScriptWorldContextValue(HScriptWorld script_world)
1133 {
1134 lua_State* L = script_world->m_Context->m_LuaState;
1135 lua_rawgeti(L, LUA_REGISTRYINDEX, script_world->m_WorldContextTableRef);
1136 // [-3] key
1137 // [-2] value
1138 // [-1] context table
1139
1140 lua_insert(L, -3);
1141 // [-3] context table
1142 // [-2] key
1143 // [-1] value
1144
1145 lua_settable(L, -3);
1146 // [-1] context table
1147
1148 lua_pop(L, 1);
1149 }
1150
1151 void GetScriptWorldContextValue(HScriptWorld script_world)
1152 {

Callers 3

SetTimerWorldFunction · 0.85
TimerNewScriptWorldFunction · 0.85

Calls 3

lua_rawgetiFunction · 0.85
lua_insertFunction · 0.85
lua_settableFunction · 0.85

Tested by 1