modified behaviour of PropertySensor and MessageSensor on popular request.
authorErwin Coumans <blender@erwincoumans.com>
Tue, 9 May 2006 23:43:14 +0000 (23:43 +0000)
committerErwin Coumans <blender@erwincoumans.com>
Tue, 9 May 2006 23:43:14 +0000 (23:43 +0000)
Logic systems should be improved, with consistent Level and Edge triggering usage in the logic bricks.

source/gameengine/GameLogic/SCA_PropertySensor.cpp
source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp

index 6f98b777d8c46a1681fdc782d2b205df4df8f8ae..979ce51ab5e55eefcfc9368f2bae50c48dccfc78 100644 (file)
@@ -260,7 +260,16 @@ bool       SCA_PropertySensor::CheckPropertyCondition()
        default:
                ; /* error */
        }
        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;
 }
 
        return result;
 }
 
index b44269faa9aaea29c8d1b6e41d5bad9318450add..67f4fb69e72540a9658aff37d060a8fe42cf1012 100644 (file)
@@ -149,7 +149,10 @@ bool KX_NetworkMessageSensor::Evaluate(CValue* event)
 bool KX_NetworkMessageSensor::IsPositiveTrigger()
 {
 //     printf("KX_NetworkMessageSensor IsPositiveTrigger\n");
 bool KX_NetworkMessageSensor::IsPositiveTrigger()
 {
 //     printf("KX_NetworkMessageSensor IsPositiveTrigger\n");
-       return m_IsUp;
+       //attempt to fix [ #3809 ] IPO Actuator does not work with some Sensors
+       //a better solution is to properly introduce separate Edge and Level triggering concept
+
+       return true;//m_IsUp;
 }
 
 /* --------------------------------------------------------------------- */
 }
 
 /* --------------------------------------------------------------------- */