diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/python/generic/mathutils.c | 12 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_GameObject.cpp | 7 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_ObjectActuator.cpp | 4 |
3 files changed, 12 insertions, 11 deletions
diff --git a/source/blender/python/generic/mathutils.c b/source/blender/python/generic/mathutils.c index f17311f4a6a..95be795dd4e 100644 --- a/source/blender/python/generic/mathutils.c +++ b/source/blender/python/generic/mathutils.c @@ -649,7 +649,8 @@ int _BaseMathObject_ReadCallback(BaseMathObject *self) if(cb->get(self, self->cb_subtype)) return 1; - PyErr_Format(PyExc_SystemError, "%s user has become invalid", Py_TYPE(self)->tp_name); + if(!PyErr_Occurred()) + PyErr_Format(PyExc_SystemError, "%s user has become invalid", Py_TYPE(self)->tp_name); return 0; } @@ -659,7 +660,8 @@ int _BaseMathObject_WriteCallback(BaseMathObject *self) if(cb->set(self, self->cb_subtype)) return 1; - PyErr_Format(PyExc_SystemError, "%s user has become invalid", Py_TYPE(self)->tp_name); + if(!PyErr_Occurred()) + PyErr_Format(PyExc_SystemError, "%s user has become invalid", Py_TYPE(self)->tp_name); return 0; } @@ -669,7 +671,8 @@ int _BaseMathObject_ReadIndexCallback(BaseMathObject *self, int index) if(cb->get_index(self, self->cb_subtype, index)) return 1; - PyErr_Format(PyExc_SystemError, "%s user has become invalid", Py_TYPE(self)->tp_name); + if(!PyErr_Occurred()) + PyErr_Format(PyExc_SystemError, "%s user has become invalid", Py_TYPE(self)->tp_name); return 0; } @@ -679,7 +682,8 @@ int _BaseMathObject_WriteIndexCallback(BaseMathObject *self, int index) if(cb->set_index(self, self->cb_subtype, index)) return 1; - PyErr_Format(PyExc_SystemError, "%s user has become invalid", Py_TYPE(self)->tp_name); + if(!PyErr_Occurred()) + PyErr_Format(PyExc_SystemError, "%s user has become invalid", Py_TYPE(self)->tp_name); return 0; } diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index abc597a9eae..ecfacb8f9bb 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -1329,7 +1329,8 @@ static int mathutils_kxgameob_vector_set(BaseMathObject *bmo, int subtype) self->NodeUpdateGS(0.f); break; case MATHUTILS_VEC_CB_SCALE_GLOBAL: - break; + PyErr_SetString(PyExc_AttributeError, "KX_GameObject.worldScale is read-only"); + return 0; case MATHUTILS_VEC_CB_INERTIA_LOCAL: /* read only */ break; @@ -1370,9 +1371,7 @@ static int mathutils_kxgameob_vector_set_index(BaseMathObject *bmo, int subtype, return 0; bmo->data[index]= f; - mathutils_kxgameob_vector_set(bmo, subtype); - - return 1; + return mathutils_kxgameob_vector_set(bmo, subtype); } Mathutils_Callback mathutils_kxgameob_vector_cb = { diff --git a/source/gameengine/Ketsji/KX_ObjectActuator.cpp b/source/gameengine/Ketsji/KX_ObjectActuator.cpp index dff95551d70..df071d50aa2 100644 --- a/source/gameengine/Ketsji/KX_ObjectActuator.cpp +++ b/source/gameengine/Ketsji/KX_ObjectActuator.cpp @@ -445,9 +445,7 @@ static int mathutils_obactu_vector_set_index(BaseMathObject *bmo, int subtype, i return 0; bmo->data[index]= f; - mathutils_obactu_vector_set(bmo, subtype); - - return 1; + return mathutils_obactu_vector_set(bmo, subtype); } Mathutils_Callback mathutils_obactu_vector_cb = { |