diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-04-11 19:59:11 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-04-11 19:59:11 +0400 |
commit | 37e53b2e1f8107cb8ddbee2d67bf984a70a71276 (patch) | |
tree | 2530148678bbc1f2aa296b88048058afc33db31d /source/gameengine | |
parent | 48514b3d52dd642a2e759dca635ff69505a7f767 (diff) |
bugfix from Moguri, AddReplica wasnt setting the light layer from the parent
Diffstat (limited to 'source/gameengine')
-rw-r--r-- | source/gameengine/Ketsji/KX_Scene.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index 30fed561519..7842076de66 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -91,6 +91,8 @@ #include "CcdPhysicsController.h" #endif +#include "KX_Light.h" + void* KX_SceneReplicationFunc(SG_IObject* node,void* gameobj,void* scene) { KX_GameObject* replica = ((KX_Scene*)scene)->AddNodeReplicaObject(node,(KX_GameObject*)gameobj); @@ -741,6 +743,12 @@ void KX_Scene::DupliGroupRecurse(CValue* obj, int level) (*git)->Relink(&m_map_gameobject_to_replica); // add the object in the layer of the parent (*git)->SetLayer(groupobj->GetLayer()); + // If the object was a light, we need to update it's RAS_LightObject as well + if ((*git)->IsLight()) + { + KX_LightObject* lightobj = static_cast<KX_LightObject*>(*git); + lightobj->GetLightData()->m_layer = groupobj->GetLayer(); + } } // replicate crosslinks etc. between logic bricks @@ -841,6 +849,12 @@ SCA_IObject* KX_Scene::AddReplicaObject(class CValue* originalobject, (*git)->Relink(&m_map_gameobject_to_replica); // add the object in the layer of the parent (*git)->SetLayer(parentobj->GetLayer()); + // If the object was a light, we need to update it's RAS_LightObject as well + if ((*git)->IsLight()) + { + KX_LightObject* lightobj = static_cast<KX_LightObject*>(*git); + lightobj->GetLightData()->m_layer = parentobj->GetLayer(); + } } // replicate crosslinks etc. between logic bricks |