From d84d38280b3ed706ff2371fc88e43a2a7245d3dd Mon Sep 17 00:00:00 2001 From: erihel Date: Sun, 2 Feb 2014 01:50:34 +0100 Subject: Changed max number of sound channels --- src/sound/oalsound/alsound.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/sound/oalsound/alsound.cpp b/src/sound/oalsound/alsound.cpp index 3f8bade..9ef9341 100644 --- a/src/sound/oalsound/alsound.cpp +++ b/src/sound/oalsound/alsound.cpp @@ -20,6 +20,7 @@ #include #include +#include #include @@ -380,7 +381,8 @@ int ALSound::Play(Sound sound, const Math::Vector &pos, float amplitude, float f if (!m_channels[channel]->Play()) { - GetLogger()->Debug("Changing channel limit to %u.\n", --m_channels_limit); + m_channels_limit = std::min(m_channels.size() - 1, m_channels_limit - 1); + GetLogger()->Debug("Changing channel limit to %u.\n", m_channels_limit); auto it = m_channels.find(channel); Channel *ch = it->second; m_channels.erase(it); -- cgit v1.2.3-1-g7c22