Skip to content

Commit b000204

Browse files
committed
Make OpenAL particle sound distance always postitive
1 parent da21660 commit b000204

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

source/game/scene/particle_system.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,9 @@ bool ParticleSystem::preRender(render::RenderDriver& driver) {
551551
if(msOffset > 64)
552552
sound->setPlayPosition(msOffset);
553553
double base_dist = abs_scale * (flow->life.max * flow->speed.max + flow->scale.max);
554+
if (base_dist < 0) {
555+
base_dist *= -1;
556+
}
554557
sound->setMinDistance(base_dist);
555558
sound->setMaxDistance(base_dist * 128.f);
556559
sound->setVolume(base_dist);

0 commit comments

Comments
 (0)