Changeset - r6891:12030c05ce3e
[Not reviewed]
master
0 1 0
rubidium - 17 years ago 2007-06-13 14:56:27
rubidium@openttd.org
(svn r10138) -Fix: when you got a sufficiently small resolution, there is a possibility for a division by zero when a sound is played.
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/sound.cpp
Show inline comments
 
@@ -211,7 +211,7 @@ static void SndPlayScreenCoordFx(SoundFx
 

	
 
			StartSound(
 
				sound,
 
				left / (vp->virtual_width / ((PANNING_LEVELS << 1) + 1)) - PANNING_LEVELS,
 
				left / max(1, vp->virtual_width / ((PANNING_LEVELS << 1) + 1)) - PANNING_LEVELS,
 
				(GetSound(sound)->volume * msf.effect_vol * _vol_factor_by_zoom[vp->zoom]) >> 15
 
			);
 
			return;
0 comments (0 inline, 0 general)