@@ -305,7 +305,7 @@ namespace NifOsg
305305 const Nif::NiSortAdjustNode* mLastAppliedNoInheritSorter = nullptr ;
306306
307307 // This is used to queue emitters that weren't attached to their node yet.
308- std::vector<std::pair<size_t , osg::ref_ptr<Emitter>>> mEmitterQueue ;
308+ std::vector<std::pair<unsigned int , osg::ref_ptr<Emitter>>> mEmitterQueue ;
309309
310310 void loadKf (Nif::FileView nif, SceneUtil::KeyframeHolder& target) const
311311 {
@@ -690,7 +690,7 @@ namespace NifOsg
690690 // - finding the correct emitter node for a particle system
691691 // - establishing connections to the animated collision shapes, which are handled in a separate loader
692692 // - finding a random child NiNode in NiBspArrayController
693- node->setUserValue (" recIndex " , nifNode->mRecordIndex );
693+ node->setUserValue (" recordIndex " , nifNode->mRecordIndex );
694694
695695 std::string extraData;
696696
@@ -1347,24 +1347,23 @@ namespace NifOsg
13471347
13481348 void handleQueuedParticleEmitters (osg::Group* rootNode, Nif::FileView nif)
13491349 {
1350- for (const auto & emitterPair : mEmitterQueue )
1350+ for (const auto & [recordIndex, emitter] : mEmitterQueue )
13511351 {
1352- auto recIndex = static_cast <unsigned >(emitterPair.first );
1353- FindGroupByRecIndex findEmitterNode (recIndex);
1352+ FindGroupByRecordIndex findEmitterNode (recordIndex);
13541353 rootNode->accept (findEmitterNode);
13551354 osg::Group* emitterNode = findEmitterNode.mFound ;
13561355 if (!emitterNode)
13571356 {
13581357 Log (Debug::Warning)
13591358 << " NIFFile Warning: Failed to find particle emitter emitter node (node record index "
1360- << recIndex << " ). File: " << nif.getFilename ();
1359+ << recordIndex << " ). File: " << nif.getFilename ();
13611360 continue ;
13621361 }
13631362
13641363 // Emitter attached to the emitter node. Note one side effect of the emitter using the CullVisitor is
13651364 // that hiding its node actually causes the emitter to stop firing. Convenient, because MW behaves this
13661365 // way too!
1367- emitterNode->addChild (emitterPair. second );
1366+ emitterNode->addChild (emitter );
13681367
13691368 DisableOptimizer disableOptimizer;
13701369 emitterNode->accept (disableOptimizer);
0 commit comments