fix for crasher with touch sensor, ben you may want to look at this, should be ok since the ray sensor does NULL checks in for getNewClientInfo in a similar area.

This commit is contained in:
Campbell Barton 2008-07-08 22:43:44 +00:00
parent bbf1ce2762
commit e279fc4a81

@ -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();