diff --git a/src/blackcore/context/contextaudioimpl.cpp b/src/blackcore/context/contextaudioimpl.cpp index d64c04760..a642e429e 100644 --- a/src/blackcore/context/contextaudioimpl.cpp +++ b/src/blackcore/context/contextaudioimpl.cpp @@ -322,7 +322,7 @@ namespace BlackCore m_voiceChannelMapping.remove(BlackMisc::Aviation::CComSystem::Com1); // If the voice channel is not used by anybody else - if (!m_voiceChannelMapping.key(oldVoiceChannel)) + if (!m_voiceChannelMapping.values().contains(oldVoiceChannel)) { oldVoiceChannel->leaveVoiceRoom(); m_unusedVoiceChannels.push_back(oldVoiceChannel); @@ -337,7 +337,7 @@ namespace BlackCore { QSharedPointer newVoiceChannel = getVoiceChannelBy(newRoomCom1); newVoiceChannel->setOwnAircraftCallsign(ownCallsign); - bool inUse = m_voiceChannelMapping.key(newVoiceChannel); + bool inUse = m_voiceChannelMapping.values().contains(newVoiceChannel); m_voiceChannelMapping.insert(BlackMisc::Aviation::CComSystem::Com1, newVoiceChannel); // If the voice channel is not used by anybody else @@ -362,7 +362,7 @@ namespace BlackCore m_voiceChannelMapping.remove(BlackMisc::Aviation::CComSystem::Com2); // If the voice channel is not used by anybody else - if (!m_voiceChannelMapping.key(oldVoiceChannel)) + if (!m_voiceChannelMapping.values().contains(oldVoiceChannel)) { oldVoiceChannel->leaveVoiceRoom(); m_unusedVoiceChannels.push_back(oldVoiceChannel); @@ -377,7 +377,7 @@ namespace BlackCore { auto newVoiceChannel = getVoiceChannelBy(newRoomCom2); newVoiceChannel->setOwnAircraftCallsign(ownCallsign); - bool inUse = m_voiceChannelMapping.key(newVoiceChannel); + bool inUse = m_voiceChannelMapping.values().contains(newVoiceChannel); m_voiceChannelMapping.insert(BlackMisc::Aviation::CComSystem::Com2, newVoiceChannel); // If the voice channel is not used by anybody else