diff options
-rw-r--r-- | source/gameengine/Ketsji/KX_TouchEventManager.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/source/gameengine/Ketsji/KX_TouchEventManager.cpp b/source/gameengine/Ketsji/KX_TouchEventManager.cpp index 80ee15a9475..423543eef5c 100644 --- a/source/gameengine/Ketsji/KX_TouchEventManager.cpp +++ b/source/gameengine/Ketsji/KX_TouchEventManager.cpp @@ -137,14 +137,18 @@ void KX_TouchEventManager::NextFrame() // KX_GameObject* gameOb1 = ctrl1->getClientInfo(); KX_ClientObjectInfo *client_info = static_cast<KX_ClientObjectInfo *>(ctrl1->getNewClientInfo()); - list<SCA_ISensor*>::iterator sit; - for ( sit = client_info->m_sensors.begin(); sit != client_info->m_sensors.end(); ++sit) - static_cast<KX_TouchSensor*>(*sit)->NewHandleCollision((*cit).first, (*cit).second, NULL); - + if (client_info) { + for ( sit = client_info->m_sensors.begin(); sit != client_info->m_sensors.end(); ++sit) { + static_cast<KX_TouchSensor*>(*sit)->NewHandleCollision((*cit).first, (*cit).second, NULL); + } + } client_info = static_cast<KX_ClientObjectInfo *>((*cit).second->getNewClientInfo()); - for ( sit = client_info->m_sensors.begin(); sit != client_info->m_sensors.end(); ++sit) - static_cast<KX_TouchSensor*>(*sit)->NewHandleCollision((*cit).second, (*cit).first, NULL); + if (client_info) { + for ( sit = client_info->m_sensors.begin(); sit != client_info->m_sensors.end(); ++sit) { + static_cast<KX_TouchSensor*>(*sit)->NewHandleCollision((*cit).second, (*cit).first, NULL); + } + } } m_newCollisions.clear(); |