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

Function CheckUserType

engine/script/src/script.cpp:844–858  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

842 }
843
844 void* CheckUserType(lua_State* L, int user_data_index, uint32_t type_hash, const char* error_message)
845 {
846 void* result = ToUserType(L, user_data_index, type_hash);
847 if (result == 0)
848 {
849 if (error_message == 0x0) {
850 const char* type = (const char*)dmHashReverse32(type_hash, 0);
851 luaL_typerror(L, user_data_index, type);
852 }
853 else {
854 luaL_error(L, "%s", error_message);
855 }
856 }
857 return result;
858 }
859
860 static bool GetMetaFunction(lua_State* L, int index, const char* meta_table_key, size_t meta_table_key_length) {
861 if (lua_getmetatable(L, index)) {

Callers 15

ScriptInstance_CheckFunction · 0.85
CheckURLFunction · 0.85
CheckHashFunction · 0.85
CheckVectorFunction · 0.85
CheckVector3Function · 0.85
CheckVector4Function · 0.85
CheckQuatFunction · 0.85
CheckMatrix4Function · 0.85
UserType_gcFunction · 0.85
TEST_FFunction · 0.85

Calls 4

ToUserTypeFunction · 0.85
dmHashReverse32Function · 0.85
luaL_errorFunction · 0.85
luaL_typerrorFunction · 0.50

Tested by 2

UserType_gcFunction · 0.68
TEST_FFunction · 0.68