summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorerihel <erihel@gmail.com>2014-02-02 01:50:34 +0100
committererihel <erihel@gmail.com>2014-02-02 01:50:34 +0100
commitd84d38280b3ed706ff2371fc88e43a2a7245d3dd (patch)
treebec1859c6c42326175fcfb284e9b6eee3218d567
parentc5ae2610b57e54216ee55214bd74368c9c7e22ee (diff)
downloadcolobot-d84d38280b3ed706ff2371fc88e43a2a7245d3dd.tar.gz
colobot-d84d38280b3ed706ff2371fc88e43a2a7245d3dd.tar.bz2
colobot-d84d38280b3ed706ff2371fc88e43a2a7245d3dd.zip
Changed max number of sound channels
-rw-r--r--src/sound/oalsound/alsound.cpp4
1 files changed, 3 insertions, 1 deletions
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 <algorithm>
#include <iomanip>
+#include <algorithm>
#include <boost/filesystem.hpp>
@@ -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);