BGE bug fix (continuation of previous bug fix):
[blender-staging.git] / source / gameengine / Ketsji / KX_NearSensor.cpp
index 397aedb3fa30a3fb5885af126f488a40144bb3e4..bae87c281238b1a05437722f397d1812e820bd5d 100644 (file)
@@ -252,8 +252,10 @@ bool       KX_NearSensor::NewHandleCollision(void* obj1,void* obj2,const PHY_CollData
                        client_info->m_gameobject :
                        NULL);
        
-       // these checks are done already in BroadPhaseFilterCollision()
-       if (gameobj /*&& (gameobj != parent)*/)
+       // Add the same check as in SCA_ISensor::Activate(), 
+       // we don't want to record collision when the sensor is not active.
+       if (m_links && !m_suspended &&
+               gameobj /* done in BroadPhaseFilterCollision() && (gameobj != parent)*/)
        {
                if (!m_colliders->SearchValue(gameobj))
                        m_colliders->Add(gameobj->AddRef());