Skip to content

Commit af34951

Browse files
committed
UPBGE: Fix group replication.
The function AddInstanceObjects and SetDupliGroupObject must be called for every objects replicated by the group.
1 parent aef8773 commit af34951

File tree

5 files changed

+13
-11
lines changed

5 files changed

+13
-11
lines changed

release/datafiles/locale

Submodule locale updated from d3349b4 to 507eacd

release/scripts/addons

Submodule addons updated 720 files

release/scripts/addons_contrib

Submodule addons_contrib updated from f178e6c to 2ff215a

source/gameengine/Ketsji/KX_Scene.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -713,13 +713,6 @@ void KX_Scene::DupliGroupRecurse(KX_GameObject *groupobj, int level)
713713
// Add to 'rootparent' list (this is the list of top hierarchy objects, updated each frame).
714714
m_parentlist->Add(CM_AddRef(replica));
715715

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-
723716
// Recurse replication into children nodes.
724717
const NodeList& children = gameobj->GetNode()->GetChildren();
725718

@@ -758,6 +751,15 @@ void KX_Scene::DupliGroupRecurse(KX_GameObject *groupobj, int level)
758751
replica->Release();
759752
}
760753

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+
761763
/* The logic must be replicated first because we need
762764
* the new logic bricks before relinking. */
763765
for (KX_GameObject *gameobj : m_logicHierarchicalGameObjects) {

source/tools

Submodule tools updated from cd4c4ec to b11375e

0 commit comments

Comments
 (0)