Commit: 0b5bf9d419407adfb3c7e1daca5c5b643da29231
Author: Porteries Tristan
Date:   Sat May 16 21:04:14 2015 +0200
Branches: master
https://developer.blender.org/rB0b5bf9d419407adfb3c7e1daca5c5b643da29231

BGE: Fix T42244 LibLoad crash with logic brick KX_TouchSensor

I remove duplicate and wrong code which treat the special case of 
KX_TouchSensor.
And Also the re-conversion of linked logic brick.

===================================================================

M       source/gameengine/Ketsji/KX_Scene.cpp

===================================================================

diff --git a/source/gameengine/Ketsji/KX_Scene.cpp 
b/source/gameengine/Ketsji/KX_Scene.cpp
index 8ed8ca6..25755f7 100644
--- a/source/gameengine/Ketsji/KX_Scene.cpp
+++ b/source/gameengine/Ketsji/KX_Scene.cpp
@@ -1892,15 +1892,6 @@ static void MergeScene_LogicBrick(SCA_ILogicBrick* 
brick, KX_Scene *from, KX_Sce
        brick->Replace_IScene(to);
        brick->Replace_NetworkScene(to->GetNetworkScene());
 
-       /* near sensors have physics controllers */
-       KX_TouchSensor *touch_sensor = dynamic_cast<class KX_TouchSensor 
*>(brick);
-       if (touch_sensor) {
-               KX_TouchEventManager *tmgr = 
(KX_TouchEventManager*)from->GetLogicManager()->FindEventManager(SCA_EventManager::TOUCH_EVENTMGR);
-               touch_sensor->UnregisterSumo(tmgr);
-               
touch_sensor->GetPhysicsController()->SetPhysicsEnvironment(to->GetPhysicsEnvironment());
-               touch_sensor->RegisterSumo(tmgr);
-       }
-
        // If we end up replacing a KX_TouchEventManager, we need to make sure
        // physics controllers are properly in place. In other words, do this
        // after merging physics controllers!
@@ -1959,17 +1950,6 @@ static void MergeScene_GameObject(KX_GameObject* 
gameobj, KX_Scene *to, KX_Scene
                {
                        SCA_IController *cont= *itc;
                        MergeScene_LogicBrick(cont, from, to);
-
-                       vector<SCA_ISensor*> linkedsensors = 
cont->GetLinkedSensors();
-                       vector<SCA_IActuator*> linkedactuators = 
cont->GetLinkedActuators();
-
-                       for (vector<SCA_IActuator*>::iterator ita = 
linkedactuators.begin();!(ita==linkedactuators.end());++ita) {
-                               MergeScene_LogicBrick(*ita, from, to);
-                       }
-
-                       for (vector<SCA_ISensor*>::iterator its = 
linkedsensors.begin();!(its==linkedsensors.end());++its) {
-                               MergeScene_LogicBrick(*its, from, to);
-                       }
                }
        }

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to