Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKester Maddock <Christopher.Maddock.1@uni.massey.ac.nz>2004-09-18 10:03:15 +0400
committerKester Maddock <Christopher.Maddock.1@uni.massey.ac.nz>2004-09-18 10:03:15 +0400
commit3d8a485fb9bef36f717423955c587ebc7834c784 (patch)
tree1bb6e995d43800196c53376560e05841ec9dcc99 /source/gameengine/Ketsji/KX_PyMath.cpp
parent0a6730d8306b31d723ab0280416f1d4fa05b4334 (diff)
Fixed PyObject_IsMT_Matrix
Diffstat (limited to 'source/gameengine/Ketsji/KX_PyMath.cpp')
-rw-r--r--source/gameengine/Ketsji/KX_PyMath.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/source/gameengine/Ketsji/KX_PyMath.cpp b/source/gameengine/Ketsji/KX_PyMath.cpp
index 47984aa22ec..5e300c4dd71 100644
--- a/source/gameengine/Ketsji/KX_PyMath.cpp
+++ b/source/gameengine/Ketsji/KX_PyMath.cpp
@@ -60,20 +60,19 @@ bool PyObject_IsMT_Matrix(PyObject *pymat, unsigned int rank)
if (rows != rank)
return false;
- for (y = 0; y < rank; y++)
+ bool ismatrix = true;
+ for (y = 0; y < rank && ismatrix; y++)
{
PyObject *pyrow = PySequence_GetItem(pymat, y); /* new ref */
if (PySequence_Check(pyrow))
{
if (PySequence_Size(pyrow) != rank)
- {
- Py_DECREF(pyrow);
- return false;
- }
- }
+ ismatrix = false;
+ } else
+ ismatrix = false;
Py_DECREF(pyrow);
}
- return true;
+ return ismatrix;
}
return false;
}