From c2805e390ef176777bd4106cd3e4ae2fa1bf3761 Mon Sep 17 00:00:00 2001 From: Rudolf Kolbe Date: Mon, 28 Oct 2024 14:22:38 +0100 Subject: [PATCH] TypeTreeHelper.cpp - fix __node__ value assignment --- UnityPyBoost/TypeTreeHelper.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/UnityPyBoost/TypeTreeHelper.cpp b/UnityPyBoost/TypeTreeHelper.cpp index 257c2339..1f2421a6 100644 --- a/UnityPyBoost/TypeTreeHelper.cpp +++ b/UnityPyBoost/TypeTreeHelper.cpp @@ -507,7 +507,7 @@ inline PyObject *parse_class(PyObject *kwargs, TypeTreeNodeObject *node, TypeTre PyErr_SetString(PyExc_ValueError, "Failed to get UnknownObject class"); goto PARSE_CLASS_CLEANUP; } - PyDict_SetItemString(kwargs, "__node__", node->m_Type); + PyDict_SetItemString(kwargs, "__node__", (PyObject *) node); } } @@ -542,7 +542,7 @@ inline PyObject *parse_class(PyObject *kwargs, TypeTreeNodeObject *node, TypeTre { Py_DECREF(clz); // 1->0 clz = PyObject_GetAttrString(config->classes, "UnknownObject"); // 0->1 - PyDict_SetItemString(kwargs, "__node__", node->m_Type); + PyDict_SetItemString(kwargs, "__node__", (PyObject *) node); } instance = PyObject_Call(clz, args, kwargs); @@ -560,7 +560,7 @@ inline PyObject *parse_class(PyObject *kwargs, TypeTreeNodeObject *node, TypeTre // if we still failed to create an instance, fallback to UnknownObject Py_DECREF(clz); clz = PyObject_GetAttrString(config->classes, "UnknownObject"); - PyDict_SetItemString(kwargs, "__node__", node->m_Type); + PyDict_SetItemString(kwargs, "__node__", (PyObject *) node); // merge extras back into kwargs pos = 0; while (PyDict_Next(extras, &pos, &key, &value))