changeset 6891:35f667adbc74 draft

(svn r10138) -Fix: when you got a sufficiently small resolution, there is a possibility for a division by zero when a sound is played.
author rubidium <rubidium@openttd.org>
date Wed, 13 Jun 2007 14:56:27 +0000
parents 774ae92da647
children 556994541424
files src/sound.cpp
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/sound.cpp
+++ b/src/sound.cpp
@@ -211,7 +211,7 @@
 
 			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;