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

Commit

Permalink
fix strange bitwise operator precedence quirk issue
Browse files Browse the repository at this point in the history
  • Loading branch information
pawnishoovy committed Nov 1, 2023
1 parent 5bedacc commit e3278b2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Managers/AudioMan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ namespace RTE {
for (const SoundSet::SoundData *soundData : selectedSoundData) {
result = (result == FMOD_OK) ? m_AudioSystem->playSound(soundData->SoundObject, channelGroupToPlayIn, true, &channel) : result;
result = (result == FMOD_OK) ? channel->getIndex(&channelIndex) : result;

result = (result == FMOD_OK) ? channel->setUserData(soundContainer) : result;
result = (result == FMOD_OK) ? channel->setCallback(SoundChannelEndedCallback) : result;
result = (result == FMOD_OK) ? channel->setPriority(soundContainer->GetPriority()) : result;
Expand Down Expand Up @@ -790,8 +790,9 @@ namespace RTE {
for (int i = 0; i < numberOfPlayingChannels; i++) {
result = m_SFXChannelGroup->getChannel(i, &soundChannel);
FMOD_MODE mode;
result = result == FMOD_OK ? soundChannel->getMode(&mode) : result;
if (mode & FMOD_2D == 0){
result = (result == FMOD_OK) ? soundChannel->getMode(&mode) : result;
unsigned modeResult = mode & FMOD_2D;
if (modeResult == 0){
FMOD_VECTOR channelPosition;
result = result == FMOD_OK ? soundChannel->get3DAttributes(&channelPosition, nullptr) : result;
result = result == FMOD_OK ? UpdatePositionalEffectsForSoundChannel(soundChannel, &channelPosition) : result;
Expand Down

0 comments on commit e3278b2

Please sign in to comment.