SoundPriority is set even when no sound is played

Issue #120 resolved
Nathan Platt created an issue

At the end of the function SD_PlaySound, SoundPriority is assinged regardless of if the sound was played:

    switch (SoundMode)
    {
        default:
            break;
        case sdm_PC:
            if(sindex.HasType(SoundData::PCSPEAKER))
                SDL_PCPlaySound((PCSound *)sindex.GetData(SoundData::PCSPEAKER));
            break;
        case sdm_AdLib:
            if(sindex.HasType(SoundData::ADLIB))
                SDL_ALPlaySound((AdLibSound *)sindex.GetData(SoundData::ADLIB));
            break;
    }

    SoundPriority = sindex.GetPriority();
    SoundPlaying = sound;

    return 0;

I ran into this when using PC speaker sounds, because the death sound was mis-assigned in the wad file. The death sound is a high priority, the sound never played and the SoundPriority variable was never reset. No other PC speaker sounds could play from that time forward because they are all lower priority.

Comments (1)

  1. Log in to comment