* Get a script container at the given stack index */
| 531 | * Get a script container at the given stack index |
| 532 | */ |
| 533 | void* 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' |
no test coverage detected