[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15494] trunk/blender/source/gameengine/ Ketsji/KX_TouchEventManager.cpp: 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 .
Campbell Barton
ideasman42 at gmail.com
Wed Jul 9 00:43:46 CEST 2008
Revision: 15494
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15494
Author: campbellbarton
Date: 2008-07-09 00:43:44 +0200 (Wed, 09 Jul 2008)
Log Message:
-----------
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.
Modified Paths:
--------------
trunk/blender/source/gameengine/Ketsji/KX_TouchEventManager.cpp
Modified: trunk/blender/source/gameengine/Ketsji/KX_TouchEventManager.cpp
===================================================================
--- trunk/blender/source/gameengine/Ketsji/KX_TouchEventManager.cpp 2008-07-08 22:30:54 UTC (rev 15493)
+++ trunk/blender/source/gameengine/Ketsji/KX_TouchEventManager.cpp 2008-07-08 22:43:44 UTC (rev 15494)
@@ -137,14 +137,18 @@
// 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();
More information about the Bf-blender-cvs
mailing list