small errors in touch sensor and gameObject
authorCampbell Barton <ideasman42@gmail.com>
Thu, 26 Feb 2009 05:17:54 +0000 (05:17 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 26 Feb 2009 05:17:54 +0000 (05:17 +0000)
source/gameengine/Ketsji/KX_GameObject.cpp
source/gameengine/Ketsji/KX_TouchSensor.cpp

index 5e013a1c6470e097ce25736c9ec6dbf786793ddb..9c6bd2edf0e9c225b34e190554cb19479894aed0 100644 (file)
@@ -1170,7 +1170,7 @@ int KX_GameObject::_setattr(const char *attr, PyObject *value)    // _setattr metho
 {
        
        if (!strcmp(attr, "parent")) {
-               PyErr_SetString(PyExc_AttributeError, "attribute \"mass\" is read only\nUse setParent()");
+               PyErr_SetString(PyExc_AttributeError, "attribute \"parent\" is read only\nUse setParent()");
                return 1;
        }
                
index de4b5c401fcd2c29de6a4fd7e5c3388b8f851727..32fcc148395ab3c750534c222aad942ef90a3621 100644 (file)
@@ -284,6 +284,8 @@ PyAttributeDef KX_TouchSensor::Attributes[] = {
        KX_PYATTRIBUTE_STRING_RW("propertyName",0,100,false,KX_TouchSensor,m_touchedpropname),
        KX_PYATTRIBUTE_BOOL_RW("materialCheck",KX_TouchSensor,m_bFindMaterial),
        KX_PYATTRIBUTE_BOOL_RW("pulseCollisions",KX_TouchSensor,m_bTouchPulse),
+       KX_PYATTRIBUTE_DUMMY("objectHit"),
+       KX_PYATTRIBUTE_DUMMY("objectHitList"),
        { NULL }        //Sentinel
 };
 
@@ -309,15 +311,6 @@ int KX_TouchSensor::_setattr(const char *attr, PyObject *value)
        if (ret >= 0)
                return ret;
        
-       if (!strcmp(attr, "objectHit")) {
-               PyErr_SetString(PyExc_AttributeError, "attribute \"objectHit\" is read only");
-               return 1;
-       }
-       if (!strcmp(attr, "objectHitList")) {
-               PyErr_SetString(PyExc_AttributeError, "attribute \"objectHit\" is read only");
-               return 1;
-       }
-       
        return SCA_ISensor::_setattr(attr, value);
 }