mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-06 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:
parent
481f23d955
commit
76fb68a9c0
1 changed files with 25 additions and 22 deletions
|
@ -825,6 +825,8 @@ namespace NifOsg
|
||||||
|
|
||||||
partsys->setFreezeOnCull(true);
|
partsys->setFreezeOnCull(true);
|
||||||
|
|
||||||
|
if (!partctrl->emitter.empty())
|
||||||
|
{
|
||||||
osg::ref_ptr<Emitter> emitter = handleParticleEmitter(partctrl);
|
osg::ref_ptr<Emitter> emitter = handleParticleEmitter(partctrl);
|
||||||
emitter->setParticleSystem(partsys);
|
emitter->setParticleSystem(partsys);
|
||||||
emitter->setReferenceFrame(osgParticle::ParticleProcessor::RELATIVE_RF);
|
emitter->setReferenceFrame(osgParticle::ParticleProcessor::RELATIVE_RF);
|
||||||
|
@ -849,6 +851,7 @@ namespace NifOsg
|
||||||
osg::ref_ptr<ParticleSystemController> callback(new ParticleSystemController(partctrl));
|
osg::ref_ptr<ParticleSystemController> callback(new ParticleSystemController(partctrl));
|
||||||
setupController(partctrl, callback, animflags);
|
setupController(partctrl, callback, animflags);
|
||||||
emitter->setUpdateCallback(callback);
|
emitter->setUpdateCallback(callback);
|
||||||
|
}
|
||||||
|
|
||||||
// affectors must be attached *after* the emitter in the scene graph for correct update order
|
// 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
|
// attach to same node as the ParticleSystem, we need osgParticle Operators to get the correct
|
||||||
|
|
Loading…
Reference in a new issue