1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 18:19:55 +00:00

Merge pull request #2959 from elsid/fix_particle_tsan

Fix TSAN warnings for ripples emitter (bug #4764)
This commit is contained in:
Bret Curtis 2020-07-11 17:22:24 +02:00 committed by GitHub
commit 9124a18bb6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -200,6 +200,7 @@ void RippleSimulation::emitRipple(const osg::Vec3f &pos)
{
if (std::abs(pos.z() - mParticleNode->getPosition().z()) < 20)
{
osgParticle::ParticleSystem::ScopedWriteLock lock(*mParticleSystem->getReadWriteMutex());
osgParticle::Particle* p = mParticleSystem->createParticle(nullptr);
p->setPosition(osg::Vec3f(pos.x(), pos.y(), 0.f));
p->setAngle(osg::Vec3f(0,0, Misc::Rng::rollProbability() * osg::PI * 2 - osg::PI));