diff --git a/src/SimulationRunner.cc b/src/SimulationRunner.cc index 5cd5db461d..9dc89832e1 100644 --- a/src/SimulationRunner.cc +++ b/src/SimulationRunner.cc @@ -796,6 +796,17 @@ void SimulationRunner::Step(const UpdateInfo &_info) IGN_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(); diff --git a/src/network/NetworkManagerSecondary.cc b/src/network/NetworkManagerSecondary.cc index e0c89bd4bc..e0c859e3b4 100644 --- a/src/network/NetworkManagerSecondary.cc +++ b/src/network/NetworkManagerSecondary.cc @@ -128,7 +128,10 @@ void NetworkManagerSecondary::OnStep( { auto parent = this->dataPtr->ecm->Component(entityId); - this->dataPtr->ecm->RequestRemoveEntity(parent->Data()); + if (parent != nullptr) + { + this->dataPtr->ecm->RequestRemoveEntity(parent->Data()); + } if (this->performers.find(entityId) != this->performers.end()) {