diff options
Diffstat (limited to 'source/gameengine')
-rw-r--r-- | source/gameengine/Ketsji/KX_GameObject.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 7b781344763..44646f17a6e 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -2188,9 +2188,15 @@ int KX_GameObject::pyattr_set_collisionCallbacks(void *self_v, const KX_PYATTRIB return PY_SET_ATTR_FAIL; } - Py_XDECREF(self->m_collisionCallbacks); + if (self->m_collisionCallbacks == NULL) { + self->RegisterCollisionCallbacks(); + } else { + Py_DECREF(self->m_collisionCallbacks); + } + Py_INCREF(value); + self->m_collisionCallbacks = value; return PY_SET_ATTR_SUCCESS; |