modified behaviour of PropertySensor and MessageSensor on popular request.
[blender.git] / source / gameengine / GameLogic / SCA_PropertySensor.cpp
index 448de10738182b55cb618ce0250033104f9ac436..979ce51ab5e55eefcfc9368f2bae50c48dccfc78 100644 (file)
@@ -260,7 +260,16 @@ bool       SCA_PropertySensor::CheckPropertyCondition()
        default:
                ; /* error */
        }
-       m_recentresult=result;
+
+       //the concept of Edge and Level triggering has unwanted effect for KX_PROPSENSOR_CHANGED
+       //see Game Engine bugtracker [ #3809 ]
+       if (m_checktype != KX_PROPSENSOR_CHANGED)
+       {
+               m_recentresult=result;
+       } else
+       {
+               m_recentresult=true;
+       }
        return result;
 }
 
@@ -318,7 +327,7 @@ PyMethodDef SCA_PropertySensor::Methods[] = {
        {NULL,NULL} //Sentinel
 };
 
-PyObject* SCA_PropertySensor::_getattr(char* attr) {
+PyObject* SCA_PropertySensor::_getattr(const STR_String& attr) {
        _getattr_up(SCA_ISensor); /* implicit return! */
 }