Fixed a rare audio crash with particle bunches
This commit is contained in:
parent
ed2e5fd81d
commit
75a6ae8cd0
1 changed files with 1 additions and 1 deletions
|
@ -97,7 +97,7 @@ public class EntityParticleBunch extends Entity {
|
|||
if (soundTicks < 0) {
|
||||
final double factor = Commons.interpolate(PARTICLE_BUNCH_ENERGY_TO_X, PARTICLE_BUNCH_ENERGY_TO_SOUND_Y, getEnergy());
|
||||
final int indexSound = (int) Math.floor(factor);
|
||||
final String sound = PARTICLE_BUNCH_SOUNDS[ Commons.clamp(0, PARTICLE_BUNCH_SOUNDS.length, indexSound) ];
|
||||
final String sound = PARTICLE_BUNCH_SOUNDS[ Commons.clamp(0, PARTICLE_BUNCH_SOUNDS.length - 1, indexSound) ];
|
||||
final float pitch = 0.6F + 0.4F * (float) (factor - indexSound);
|
||||
|
||||
soundTicks = (int) Math.floor(ACCELERATION_SOUND_UPDATE_TICKS * pitch);
|
||||
|
|
Loading…
Add table
Reference in a new issue