@@ -713,13 +713,6 @@ void KX_Scene::DupliGroupRecurse(KX_GameObject *groupobj, int level)
713
713
// Add to 'rootparent' list (this is the list of top hierarchy objects, updated each frame).
714
714
m_parentlist->Add (CM_AddRef (replica));
715
715
716
- /* Set references for dupli-group
717
- * groupobj holds a list of all objects, that belongs to this group. */
718
- groupobj->AddInstanceObjects (replica);
719
-
720
- // Every object gets the reference to its dupli-group object.
721
- replica->SetDupliGroupObject (groupobj);
722
-
723
716
// Recurse replication into children nodes.
724
717
const NodeList& children = gameobj->GetNode ()->GetChildren ();
725
718
@@ -758,6 +751,15 @@ void KX_Scene::DupliGroupRecurse(KX_GameObject *groupobj, int level)
758
751
replica->Release ();
759
752
}
760
753
754
+ // Do the linking of member objects to group object for every objects.
755
+ for (KX_GameObject *gameobj : m_logicHierarchicalGameObjects) {
756
+ /* Set references for dupli-group
757
+ * groupobj holds a list of all objects, that belongs to this group. */
758
+ groupobj->AddInstanceObjects (gameobj);
759
+ // Every object gets the reference to its dupli-group object.
760
+ gameobj->SetDupliGroupObject (groupobj);
761
+ }
762
+
761
763
/* The logic must be replicated first because we need
762
764
* the new logic bricks before relinking. */
763
765
for (KX_GameObject *gameobj : m_logicHierarchicalGameObjects) {
0 commit comments