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.
This commit is contained in:
Campbell Barton
2009-05-16 00:49:28 +00:00
parent 83006e51f8
commit 006ad4aaac
3 changed files with 7 additions and 9 deletions

View File

@@ -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)
{