From df8cf26404c7e922751643b1095e38f1ab430811 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 17 Apr 2009 20:06:06 +0000 Subject: Added m_zombie to the base python class (PyObjectPlus), when this is set all the subclasses will raise an error on access to their members. Other small changes... - KX_Camera and KX_Light didnt have get/setitem access in their PyType definition. - CList.from_id() error checking for a long was checking for -1 against an unsigned value (own fault) - CValue::SpecialRelease was incrementing an int for no reason. - renamed m_attrlist to m_attr_dict since its a PyDict type. - removed custom getattro/setattro functions for KX_Scene and KX_GameObject, use py_base_getattro, py_base_setattro for all subclasses of PyObjectPlus. - lowercase windows.h in VideoBase.cpp for cross compiling. --- source/gameengine/Ketsji/KX_Light.cpp | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'source/gameengine/Ketsji/KX_Light.cpp') diff --git a/source/gameengine/Ketsji/KX_Light.cpp b/source/gameengine/Ketsji/KX_Light.cpp index 0fcd2c39078..29033c2d802 100644 --- a/source/gameengine/Ketsji/KX_Light.cpp +++ b/source/gameengine/Ketsji/KX_Light.cpp @@ -177,14 +177,6 @@ PyObject* KX_LightObject::py_getattro(PyObject *attr) { char *attr_str= PyString_AsString(attr); - if (ValidPythonToGameObject(this)==false) { - if (!strcmp(attr_str, "isValid")) { - PyErr_Clear(); - Py_RETURN_FALSE; - } - return NULL; - } - if (!strcmp(attr_str, "layer")) return PyInt_FromLong(m_lightobj.m_layer); @@ -229,9 +221,6 @@ int KX_LightObject::py_setattro(PyObject *attr, PyObject *pyvalue) { char *attr_str= PyString_AsString(attr); - if (ValidPythonToGameObject(this)==false) - return -1; - if (PyInt_Check(pyvalue)) { int value = PyInt_AsLong(pyvalue); @@ -347,7 +336,9 @@ PyTypeObject KX_LightObject::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, + 0,0, + &KX_GameObject::Mapping, + 0,0,0, py_base_getattro, py_base_setattro, 0,0,0,0,0,0,0,0,0, -- cgit v1.2.3