[Orxonox-commit 2364] r7079 - code/branches/presentation3/src/orxonox/controllers

landauf at orxonox.net landauf at orxonox.net
Wed Jun 2 01:58:38 CEST 2010


Author: landauf
Date: 2010-06-02 01:58:37 +0200 (Wed, 02 Jun 2010)
New Revision: 7079

Modified:
   code/branches/presentation3/src/orxonox/controllers/NewHumanController.cc
Log:
fixed a bug in NewHumanController - Ogre::any_cast can fail after raytracing (occurred in fps levels when looking at the floor - maybe someone can check why this happens)

Modified: code/branches/presentation3/src/orxonox/controllers/NewHumanController.cc
===================================================================
--- code/branches/presentation3/src/orxonox/controllers/NewHumanController.cc	2010-06-01 23:53:41 UTC (rev 7078)
+++ code/branches/presentation3/src/orxonox/controllers/NewHumanController.cc	2010-06-01 23:58:37 UTC (rev 7079)
@@ -377,7 +377,15 @@
             if (itr->movable->isInScene() && itr->movable->getMovableType() == "Entity" /*&& itr->distance > 500*/)
             {
                 // Try to cast the user pointer
-                WorldEntity* wePtr = dynamic_cast<WorldEntity*>(Ogre::any_cast<OrxonoxClass*>(itr->movable->getUserAny()));
+                WorldEntity* wePtr;
+                try
+                {
+                    wePtr = dynamic_cast<WorldEntity*>(Ogre::any_cast<OrxonoxClass*>(itr->movable->getUserAny()));
+                }
+                catch (...)
+                {
+                    continue;
+                }
 
                 // make sure we don't shoot ourselves
                 if( wePtr==myWe )




More information about the Orxonox-commit mailing list