diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-05-16 04:49:28 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-05-16 04:49:28 +0400 |
commit | 006ad4aaacc36a7e7fd1a8cd96e60a5e74cbfedd (patch) | |
tree | 929a9d1452a4901986c38f37c7e03774f591c7ca /source/gameengine/Ketsji/KX_GameObject.cpp | |
parent | 83006e51f845b2c5c36539373e036be3efaddc16 (diff) |
BGE Py API Bugfixes
KX_GameObject.getVelocity() would set an error but nor return an error value when an non vector argument was given.
KX_PythonSeq_Type was not initialized with PyType_Ready which could crash blender when inspecting the type.
Diffstat (limited to 'source/gameengine/Ketsji/KX_GameObject.cpp')
-rw-r--r-- | source/gameengine/Ketsji/KX_GameObject.cpp | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 9196d1e0527..ae30aeb971c 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -2051,14 +2051,8 @@ PyObject* KX_GameObject::PyGetVelocity(PyObject* args) MT_Point3 point(0.0,0.0,0.0); PyObject* pypos = NULL; - if (PyArg_ParseTuple(args, "|O:getVelocity", &pypos)) - { - if (pypos) - PyVecTo(pypos, point); - } - else { + if (!PyArg_ParseTuple(args, "|O:getVelocity", &pypos) || (pypos && !PyVecTo(pypos, point))) return NULL; - } if (m_pPhysicsController1) { |