Wrong sound for exit switches

From DoomWiki.org

Reading the code, it is obvious that at some point exit switches were meant to have the alternative switch sound DSSWTCHX rather than the normal DSSWTCHN. However due to a logic error the code to change the sound effect is never executed.


The intention of this code, from P_ChangeSwitchTexture (p_switch.c) is clear:

    if (line->special == 11)
        sound = sfx_swtchx;

Unfortunately, a few lines up in the same function, the following is written:

    if (!useAgain)
        line->special = 0;

Thus line->special is zeroed out before it can be tested against the special number for an exit switch. (Exit switches are not considered repeatable.)

Note also that secret exit switches (special number 51) are not handled at all.