diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-04-23 00:43:41 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-04-23 00:43:41 +0400 |
commit | fd108f101988ad119b8a5ed4e83cd64227fc1e96 (patch) | |
tree | 98c6468874e42621dc621a2011736ddcf5b81a39 | |
parent | f06802050d00cde6eeda93bb074599a1b8c8e7b5 (diff) |
[#18586] [bug] Ray sensor doesn't return a hit object
Supporting len(GameOb) to see how many properties it has backfired since it can then evaluate as false.
-rw-r--r-- | source/gameengine/Ketsji/KX_GameObject.cpp | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index ecc887eb567..bf6a81c8493 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -1192,21 +1192,6 @@ PyObject* KX_GameObject::PyGetPosition() return PyObjectFrom(NodeGetWorldPosition()); } - -Py_ssize_t KX_GameObject::Map_Len(PyObject* self_v) -{ - KX_GameObject* self= static_cast<KX_GameObject*>BGE_PROXY_REF(self_v); - - if (self==NULL) /* not sure what to do here */ - return 0; - - Py_ssize_t len= self->GetPropertyCount(); - if(self->m_attr_dict) - len += PyDict_Size(self->m_attr_dict); - return len; -} - - PyObject *KX_GameObject::Map_GetItem(PyObject *self_v, PyObject *item) { KX_GameObject* self= static_cast<KX_GameObject*>BGE_PROXY_REF(self_v); @@ -1329,9 +1314,9 @@ int KX_GameObject::Map_SetItem(PyObject *self_v, PyObject *key, PyObject *val) return 0; /* success */ } - +/* Cant set the len otherwise it can evaluate as false */ PyMappingMethods KX_GameObject::Mapping = { - (lenfunc)KX_GameObject::Map_Len, /*inquiry mp_length */ + (lenfunc)NULL , /*inquiry mp_length */ (binaryfunc)KX_GameObject::Map_GetItem, /*binaryfunc mp_subscript */ (objobjargproc)KX_GameObject::Map_SetItem, /*objobjargproc mp_ass_subscript */ }; |