Weapon pickup message not displayed in multiplayer

When weapons are picked up in multiplayer, cooperative or deathmatch, they stay on the floor. The game engine handles them differently from normal weapon that disappear from the floor when picked up, such as weapon dropped by monsters, weapons in single player mode or weapons in altdeath mode. Since the weapon pickup in single player is handled the same way in altdeath, this deathmatch mode is not affected by the bug. Older versions of Doom that did not have altdeath are also affected by this bug.

Technical details
The code that handle the weapon pickup is located in the file p_inter.c inside the function P_TouchSpecialThing. This function contains a switch-case that tries to detect which kind of thing was touched by the player. This is an example of case:

case SPR_SHOT: if (!P_GiveWeapon(player, wp_shotgun, (special->flags & MF_DROPPED) != 0)) return; player->message = DEH_String(GOTSHOTGUN); sound = sfx_wpnup; break;

The function P_GiveWeapon is called. It evaluates if the player can take the weapon. If the player can take the weapon, this function would return true in single player mode or altdeath. In cooperative or normal deathmatch, the code takes a different path inside P_GiveWeapon and the function always return false. The condition inside the case is evaluated to true due to the negative operator and the function P_TouchSpecialThing returns, skipping the assignation of the weapon pickup message. Exiting this function early also skips the code that removes the weapon from the game which is the intended behavior in cooperative or deathmatch. When playing single player or altdeath, the code continues inside the same function. This sets the correct weapon pickup message, but removes the weapon from the game.

Links

 * Explanation of the bug on Github