Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/SimulationRunner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,17 @@ void SimulationRunner::Step(const UpdateInfo &_info)
GZ_PROFILE("SimulationRunner::Step");
this->currentInfo = _info;

// The Run method does not check for entity creation each iteration
// on network secondaries, so check here to ensure that performers
// have parents assigned.
if (this->networkMgr && this->networkMgr->IsSecondary())
{
if (this->createEntities)
{
this->CreateEntities();
}
}

// Process new ECM state information, typically sent from the GUI after
// a change was made to the GUI's ECM.
this->ProcessNewWorldControlState();
Expand Down
5 changes: 4 additions & 1 deletion src/network/NetworkManagerSecondary.cc
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,10 @@ void NetworkManagerSecondary::OnStep(
{
auto parent =
this->dataPtr->ecm->Component<components::ParentEntity>(entityId);
this->dataPtr->ecm->RequestRemoveEntity(parent->Data());
if (parent != nullptr)
{
this->dataPtr->ecm->RequestRemoveEntity(parent->Data());
}

if (this->performers.find(entityId) != this->performers.end())
{
Expand Down
Loading