svn merge -r 16396:16411 https://svn.blender.org/svnroot/bf-blender/trunk/blender
authorDaniel Genrich <daniel.genrich@gmx.net>
Sun, 7 Sep 2008 19:47:15 +0000 (19:47 +0000)
committerDaniel Genrich <daniel.genrich@gmx.net>
Sun, 7 Sep 2008 19:47:15 +0000 (19:47 +0000)
1  2 
source/gameengine/Converter/KX_BlenderSceneConverter.cpp

index e246e49af3f1a726d6725154eeb791fa13696bd3,4734b84de54d25475896a7905e441d4a2a170267..2ce325326a888c5eb2e2141e64c788ad1387fdf9
@@@ -246,11 -246,6 +246,11 @@@ struct   BlenderDebugDraw : public btIDeb
        {
                return m_debugMode;
        }
 +      ///todo: find out if Blender can do this
 +      virtual void    draw3dText(const btVector3& location,const char* textString)
 +      {
 +
 +      }
                
  };
  
@@@ -501,7 -496,17 +501,17 @@@ void KX_BlenderSceneConverter::Register
  void KX_BlenderSceneConverter::UnregisterGameObject(
                                                                        KX_GameObject *gameobject) 
  {
-       m_map_gameobject_to_blender.remove(CHashedPtr(gameobject));
+       CHashedPtr gptr(gameobject);
+       struct Object **bobp= m_map_gameobject_to_blender[gptr];
+       if (bobp) {
+               CHashedPtr bptr(*bobp);
+               KX_GameObject **gobp= m_map_blender_to_gameobject[bptr];
+               if (gobp && *gobp == gameobject)
+                       // also maintain m_map_blender_to_gameobject if the gameobject
+                       // being removed is matching the blender object
+                       m_map_blender_to_gameobject.remove(bptr);
+               m_map_gameobject_to_blender.remove(gptr);
+       }
  }