Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/gameengine/Ketsji/KX_Light.h2
-rw-r--r--source/gameengine/Ketsji/KX_Scene.cpp3
2 files changed, 5 insertions, 0 deletions
diff --git a/source/gameengine/Ketsji/KX_Light.h b/source/gameengine/Ketsji/KX_Light.h
index c31f33f26ae..334aed1995d 100644
--- a/source/gameengine/Ketsji/KX_Light.h
+++ b/source/gameengine/Ketsji/KX_Light.h
@@ -65,6 +65,8 @@ public:
void UnbindShadowBuffer(class RAS_IRasterizer *ras);
void Update();
+ void UpdateScene(class KX_Scene *kxscene) {m_lightobj.m_scene = (void*)kxscene;}
+
virtual int GetGameObjectType() { return OBJ_LIGHT; }
#ifndef DISABLE_PYTHON
diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp
index 3547a6db545..a5512c2e34a 100644
--- a/source/gameengine/Ketsji/KX_Scene.cpp
+++ b/source/gameengine/Ketsji/KX_Scene.cpp
@@ -1754,6 +1754,9 @@ static void MergeScene_GameObject(KX_GameObject* gameobj, KX_Scene *to, KX_Scene
phys_ctrl->SetPhysicsEnvironment(to->GetPhysicsEnvironment());
}
}
+ /* If the object is a light, update it's scene */
+ if (gameobj->GetGameObjectType() == SCA_IObject::OBJ_LIGHT)
+ ((KX_LightObject*)gameobj)->UpdateScene(to);
/* Add the object to the scene's logic manager */
to->GetLogicManager()->RegisterGameObjectName(gameobj->GetName(), gameobj);