From 53d75684ee9d037bc21ec1a5b514ac658ae8dbea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Mon, 29 Oct 2018 16:34:03 +0100 Subject: [PATCH] Prevent shadowing of global variable in function argument --- client/CMusicHandler.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/CMusicHandler.cpp b/client/CMusicHandler.cpp index d5c516dde..c67836dec 100644 --- a/client/CMusicHandler.cpp +++ b/client/CMusicHandler.cpp @@ -279,27 +279,27 @@ bool CSoundHandler::ambientCheckVisitable() const return !allTilesSource; } -void CSoundHandler::ambientUpdateChannels(std::map sounds) +void CSoundHandler::ambientUpdateChannels(std::map soundsArg) { boost::mutex::scoped_lock guard(mutex); std::vector stoppedSounds; for(auto & pair : ambientChannels) { - if(!vstd::contains(sounds, pair.first)) + if(!vstd::contains(soundsArg, pair.first)) { ambientStopSound(pair.first); stoppedSounds.push_back(pair.first); } else { - CCS->soundh->setChannelVolume(pair.second, ambientDistToVolume(sounds[pair.first])); + CCS->soundh->setChannelVolume(pair.second, ambientDistToVolume(soundsArg[pair.first])); } } for(auto soundId : stoppedSounds) ambientChannels.erase(soundId); - for(auto & pair : sounds) + for(auto & pair : soundsArg) { if(!vstd::contains(ambientChannels, pair.first)) {