Handle particle systems that don't have emitters

Fixes a crash in the Magic Diversity mod.
pull/752/head
scrawl 9 years ago
parent 481f23d955
commit 76fb68a9c0

@ -825,6 +825,8 @@ namespace NifOsg
partsys->setFreezeOnCull(true);
if (!partctrl->emitter.empty())
{
osg::ref_ptr<Emitter> emitter = handleParticleEmitter(partctrl);
emitter->setParticleSystem(partsys);
emitter->setReferenceFrame(osgParticle::ParticleProcessor::RELATIVE_RF);
@ -849,6 +851,7 @@ namespace NifOsg
osg::ref_ptr<ParticleSystemController> callback(new ParticleSystemController(partctrl));
setupController(partctrl, callback, animflags);
emitter->setUpdateCallback(callback);
}
// affectors must be attached *after* the emitter in the scene graph for correct update order
// attach to same node as the ParticleSystem, we need osgParticle Operators to get the correct

Loading…
Cancel
Save