1% damage bug

From DoomWiki.org

Under construction icon-yellow.svgThis article or section is a stub. Please help the Doom Wiki by adding to it.

Events inflicting only a single point of damage on the player can lead to some slightly unusual effects.

In Doom, when playing on I'm Too Young To Die! difficulty, damage taken by the player is reduced by half. However, as health and damage are integer values, the attempt to halve the single-point value with a bit shift[1] simply reduces it to zero. The code does not check for this outcome, and as a result, the remainder of the damage function proceeds as normal, including causing the player to emit their pain sound and their sprite to enter its pain state. Likewise, the player's screen will not turn red, as the function which controls palette changes does check if the player's recent damage is above zero.[2]

This can also occur on any skill level with other attacks which inflict zero damage, such as the zero-damage impact of a gargoyle's charge in Heretic.

References[edit]