Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit e3278b2

Browse files
committed
fix strange bitwise operator precedence quirk issue
1 parent 5bedacc commit e3278b2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Managers/AudioMan.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ namespace RTE {
596596
for (const SoundSet::SoundData *soundData : selectedSoundData) {
597597
result = (result == FMOD_OK) ? m_AudioSystem->playSound(soundData->SoundObject, channelGroupToPlayIn, true, &channel) : result;
598598
result = (result == FMOD_OK) ? channel->getIndex(&channelIndex) : result;
599-
599+
600600
result = (result == FMOD_OK) ? channel->setUserData(soundContainer) : result;
601601
result = (result == FMOD_OK) ? channel->setCallback(SoundChannelEndedCallback) : result;
602602
result = (result == FMOD_OK) ? channel->setPriority(soundContainer->GetPriority()) : result;
@@ -790,8 +790,9 @@ namespace RTE {
790790
for (int i = 0; i < numberOfPlayingChannels; i++) {
791791
result = m_SFXChannelGroup->getChannel(i, &soundChannel);
792792
FMOD_MODE mode;
793-
result = result == FMOD_OK ? soundChannel->getMode(&mode) : result;
794-
if (mode & FMOD_2D == 0){
793+
result = (result == FMOD_OK) ? soundChannel->getMode(&mode) : result;
794+
unsigned modeResult = mode & FMOD_2D;
795+
if (modeResult == 0){
795796
FMOD_VECTOR channelPosition;
796797
result = result == FMOD_OK ? soundChannel->get3DAttributes(&channelPosition, nullptr) : result;
797798
result = result == FMOD_OK ? UpdatePositionalEffectsForSoundChannel(soundChannel, &channelPosition) : result;

0 commit comments

Comments
 (0)