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

Function GetInstanceContextValue

engine/script/src/script.cpp:1322–1356  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1320 }
1321
1322 void GetInstanceContextValue(lua_State* L)
1323 {
1324 // [-1] key
1325 DM_LUA_STACK_CHECK(L, 0);
1326
1327 GetInstanceContextTable(L);
1328 // [-2] key
1329 // [-1] instance context table or LUA_NIL
1330
1331 if (lua_type(L, -1) != LUA_TTABLE)
1332 {
1333 lua_pop(L, 2);
1334
1335 lua_pushnil(L);
1336 // [-1] LUA_NIL
1337 return;
1338 }
1339 // [-2] key
1340 // [-1] instance context table
1341
1342 lua_insert(L, -2);
1343 // [-2] instance context table
1344 // [-1] key
1345
1346 lua_gettable(L, -2);
1347 // [-2] instance context table
1348 // [-1] value
1349
1350 lua_insert(L, -2);
1351 // [-2] value
1352 // [-1] instance context table
1353
1354 lua_pop(L, 1);
1355 // [-1] value
1356 }
1357
1358 int RefInInstance(lua_State* L)
1359 {

Callers 6

TestGetInstanceContextFunction · 0.85
GetTimerWorldFunction · 0.85
TEST_FFunction · 0.85
TEST_FFunction · 0.85
TEST_FFunction · 0.85

Calls 5

GetInstanceContextTableFunction · 0.85
lua_typeFunction · 0.85
lua_pushnilFunction · 0.85
lua_insertFunction · 0.85
lua_gettableFunction · 0.85

Tested by 5

TestGetInstanceContextFunction · 0.68
TEST_FFunction · 0.68
TEST_FFunction · 0.68
TEST_FFunction · 0.68