diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-02-15 12:01:52 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-02-15 12:01:52 +0300 |
commit | ea8b072b75e5242343dbb4910599f8c37d3bf80f (patch) | |
tree | 8c60961a7102dab9b11f60e4956da81882591f5e /source/gameengine/Ketsji/KX_Scene.cpp | |
parent | 83fd3fbb433c3899f92de2078dd6a9350722da8d (diff) |
[#21023] 2 Dynamic loading patches (one bugfix, one feature)
patch from Mitchell Stokes (moguri), only the bugfix part for now.
Diffstat (limited to 'source/gameengine/Ketsji/KX_Scene.cpp')
-rw-r--r-- | source/gameengine/Ketsji/KX_Scene.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index 9eee8857e98..986476acd99 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -1754,6 +1754,13 @@ static void MergeScene_GameObject(KX_GameObject* gameobj, KX_Scene *to, KX_Scene phys_ctrl->SetPhysicsEnvironment(to->GetPhysicsEnvironment()); } } + + /* Add the object to the scene's logic manager */ + to->GetLogicManager()->RegisterGameObjectName(gameobj->GetName(), gameobj); + to->GetLogicManager()->RegisterGameObj(gameobj->GetBlenderObject(), gameobj); + + for (int i=0; i<gameobj->GetMeshCount(); ++i) + to->GetLogicManager()->RegisterGameMeshName(gameobj->GetMesh(i)->GetName(), gameobj->GetBlenderObject()); } bool KX_Scene::MergeScene(KX_Scene *other) @@ -1823,7 +1830,7 @@ bool KX_Scene::MergeScene(KX_Scene *other) //SCA_EventManager *evtmgr; SCA_EventManager *evtmgr_other; - for(int i= 0; i < evtmgrs.size(); i++) { + for(unsigned int i= 0; i < evtmgrs.size(); i++) { evtmgr_other= logicmgr_other->FindEventManager(evtmgrs[i]->GetType()); if(evtmgr_other) /* unlikely but possible one scene has a joystick and not the other */ |