1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-09-03 03:49:12 +00:00

(svn r10138) -Fix: when you got a sufficiently small resolution, there is a possibility for a division by zero when a sound is played.

This commit is contained in:
rubidium
2007-06-13 14:56:27 +00:00
parent 112f05e705
commit 504d93c499

View File

@@ -211,7 +211,7 @@ static void SndPlayScreenCoordFx(SoundFx sound, int x, int y)
StartSound( StartSound(
sound, 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 (GetSound(sound)->volume * msf.effect_vol * _vol_factor_by_zoom[vp->zoom]) >> 15
); );
return; return;