* __index meta methods for collision related enums */
| 1102 | * __index meta methods for collision related enums |
| 1103 | */ |
| 1104 | static 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 | |
| 1126 | static int32 ECollisionChannel_Index(lua_State *L) |
| 1127 | { |
no test coverage detected