* Test whether this object is of the specified type */
| 164 | * Test whether this object is of the specified type |
| 165 | */ |
| 166 | static int32 UObject_IsA(lua_State* L) |
| 167 | { |
| 168 | int32 NumParams = lua_gettop(L); |
| 169 | if (NumParams != 2) |
| 170 | return luaL_error(L, "invalid parameters"); |
| 171 | |
| 172 | UObject* Object = UnLua::GetUObject(L, 1); |
| 173 | if (!UnLua::IsUObjectValid(Object)) |
| 174 | return luaL_error(L, "invalid object"); |
| 175 | |
| 176 | UObject* ClassObject = UnLua::GetUObject(L, 2); |
| 177 | if (!UnLua::IsUObjectValid(ClassObject)) |
| 178 | return luaL_error(L, "invalid class"); |
| 179 | |
| 180 | UClass* Class = Cast<UClass>(ClassObject); |
| 181 | if (!Class) |
| 182 | return luaL_error(L, "invalid class"); |
| 183 | |
| 184 | bool bValid = Object->IsA(Class); |
| 185 | lua_pushboolean(L, bValid); |
| 186 | return 1; |
| 187 | } |
| 188 | |
| 189 | static int32 UObject_Release(lua_State* L) |
| 190 | { |
nothing calls this directly
no test coverage detected