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

Function CollisionEnum_Index

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

* __index meta methods for collision related enums */

Source from the content-addressed store, hash-verified

1102 * __index meta methods for collision related enums
1103 */
1104static int32 CollisionEnum_Index(lua_State *L, int32(*Converter)(FName))
1105{
1106 const char *Name = lua_tostring(L, -1);
1107 if (Name)
1108 {
1109 int32 Value = Converter(FName(Name));
1110 if (Value == INDEX_NONE)
1111 {
1112 UNLUA_LOGERROR(L, LogUnLua, Warning, TEXT("%s: Cann't find enum %s!"), ANSI_TO_TCHAR(__FUNCTION__), ANSI_TO_TCHAR(Name));
1113 }
1114 lua_pushvalue(L, 2);
1115 lua_pushinteger(L, Value);
1116 lua_rawset(L, 1);
1117 lua_pushinteger(L, Value);
1118 }
1119 else
1120 {
1121 lua_pushinteger(L, INDEX_NONE);
1122 }
1123 return 1;
1124}
1125
1126static int32 ECollisionChannel_Index(lua_State *L)
1127{

Callers 3

ECollisionChannel_IndexFunction · 0.85
EObjectTypeQuery_IndexFunction · 0.85
ETraceTypeQuery_IndexFunction · 0.85

Calls 3

lua_pushvalueFunction · 0.85
lua_pushintegerFunction · 0.85
lua_rawsetFunction · 0.85

Tested by

no test coverage detected