From 504d93c4993d853d49bca7743467b9b41770a7a0 Mon Sep 17 00:00:00 2001 From: rubidium Date: Wed, 13 Jun 2007 14:56:27 +0000 Subject: (svn r10138) -Fix: when you got a sufficiently small resolution, there is a possibility for a division by zero when a sound is played. --- src/sound.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/sound.cpp') diff --git a/src/sound.cpp b/src/sound.cpp index ac8f3c2fa..249ff73e3 100644 --- a/src/sound.cpp +++ b/src/sound.cpp @@ -211,7 +211,7 @@ static void SndPlayScreenCoordFx(SoundFx sound, int x, int y) 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; -- cgit v1.2.3-54-g00ecf