Skip to content

Commit 6ed5b8e

Browse files
author
Roberto De Ioris
committed
added clone() method to structs
1 parent ef8e0c1 commit 6ed5b8e

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎Source/UnrealEnginePython/Private/UEPyUScriptStruct.cpp‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,16 @@ static PyObject *py_ue_uscriptstruct_get_struct(ue_PyUScriptStruct *self, PyObje
5959
return (PyObject *)ret;
6060
}
6161

62+
static PyObject *py_ue_uscriptstruct_clone(ue_PyUScriptStruct *self, PyObject * args) {
63+
return py_ue_new_uscriptstruct(self->u_struct, self->data);
64+
}
65+
6266
static PyMethodDef ue_PyUScriptStruct_methods[] = {
6367
{ "get_field", (PyCFunction)py_ue_uscriptstruct_get_field, METH_VARARGS, "" },
6468
{ "set_field", (PyCFunction)py_ue_uscriptstruct_set_field, METH_VARARGS, "" },
6569
{ "fields", (PyCFunction)py_ue_uscriptstruct_fields, METH_VARARGS, "" },
6670
{ "get_struct", (PyCFunction)py_ue_uscriptstruct_get_struct, METH_VARARGS, "" },
71+
{ "clone", (PyCFunction)py_ue_uscriptstruct_clone, METH_VARARGS, "" },
6772
{ NULL } /* Sentinel */
6873
};
6974

0 commit comments

Comments
 (0)