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:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user