1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-29 09:45:32 +00:00

Handle particle systems that don't have emitters

Fixes a crash in the Magic Diversity mod.
This commit is contained in:
scrawl 2015-09-07 22:07:09 +02:00
parent 481f23d955
commit 76fb68a9c0

View file

@ -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