PyObject *py_ue_actor_destroy_component(ue_PyUObject * self, PyObject * args) { ue_py_check(self); AActor *actor = ue_get_actor(self); if (!actor) return PyErr_Format(PyExc_Exception, "cannot retrieve Actor from uobject"); PyObject *py_component; if (!PyArg_ParseTuple(args, "O:actor_destroy_component", &py_component)) { return NULL; } UActorComponent *component = ue_py_check_type<UActorComponent>(py_component); if (!component) return PyErr_Format(PyExc_Exception, "argument is not a UActorComponent"); #if ENGINE_MINOR_VERSION >= 17 component->DestroyComponent(); #else actor->K2_DestroyComponent(component); #endif Py_INCREF(Py_None); return Py_None; }
PyObject *py_ue_destroy_component(ue_PyUObject * self, PyObject * args) { ue_py_check(self); UActorComponent *component = ue_py_check_type<UActorComponent>(self); if (!component) return PyErr_Format(PyExc_Exception, "uobject is not an UActorComponent"); component->DestroyComponent(); Py_RETURN_NONE; }