MCPcopy Create free account
hub / github.com/Tencent/UnLua / GetScriptContainer

Function GetScriptContainer

Plugins/UnLua/Source/UnLua/Private/LuaCore.cpp:533–548  ·  view source on GitHub ↗

* Get a script container at the given stack index */

Source from the content-addressed store, hash-verified

531 * Get a script container at the given stack index
532 */
533void* GetScriptContainer(lua_State *L, int32 Index)
534{
535 TValue* Value = GetTValue(L, Index);
536 if ((Value->tt_ & 0x0F) == LUA_TUSERDATA)
537 {
538 uint8 Flag = (BIT_VARIANT_TAG | BIT_SCRIPT_CONTAINER); // variant tags
539
540 Udata* U = GetUdata(Value);
541 FUserdataDesc* UserdataDesc = GetUserdataDesc(U);
542 if (UserdataDesc)
543 {
544 return (UserdataDesc->tag & Flag) == Flag ? *((void**)GetUdataMem(U)) : nullptr;
545 }
546 }
547 return nullptr;
548}
549
550/**
551 * Remove a cached script container from 'ScriptContainerMap'

Callers 6

GetArrayFunction · 0.85
GetSetFunction · 0.85
GetMapFunction · 0.85
CopyBackMethod · 0.85
CopyBackMethod · 0.85
CopyBackMethod · 0.85

Calls 4

GetTValueFunction · 0.85
GetUdataFunction · 0.85
GetUserdataDescFunction · 0.85
GetUdataMemFunction · 0.85

Tested by

no test coverage detected