Projectiles triggering linedefs

From DoomWiki.org

Lift being activated by plasma bolt

In various versions of Doom and Doom II, it is possible for a walk-over linedef to have its action activated by projectiles which cross the linedef. This affects the following linetypes:

  • 4: W1 Door
  • 10: W1 Lift Also Monsters
  • 39: W1 Teleport
  • 88: WR Lift Also Monsters
  • 97: WR Teleport
  • 125: W1 Teleport Monsters Only
  • 126: WR Teleport Monsters Only

Doom v1.3[edit]

In Doom v1.3 and lower, any projectile is capable of activating walk-over linedefs, as seen in the screenshots to the right where the player's plasma gun is being fired and the resulting projectiles have caused a nearby lift to lower. This was repaired by id Software starting with v1.4 via addition of the following code to the function P_CrossSpecialLine in p_spec.c at line 509 [1]:

	// Things that should NOT trigger specials...
	switch(thing->type)
	{
	  case MT_ROCKET:
	  case MT_PLASMA:
	  case MT_BFG:
	  case MT_TROOPSHOT:
	  case MT_HEADSHOT:
	  case MT_BRUISERSHOT:
	    return;
	    break;
	    
	  default: break;
	}

Doom v1.666[edit]

Starting with the release of Doom II, various additional monsters were added which fire new projectile types, including the arachnotron, revenant, and mancubus. However, their corresponding projectile types were not added as cases in the switch statement added to originally repair the problem. This means that in v1.666 and all higher versions, walk-over linedef actions can again be activated by these projectiles.

It is notable that this problem could have been avoided by using a simple if(thing->flags & MF_MISSILE) return; check, similar to one already present in the code for teleporters.

Other games[edit]

As Heretic's codebase is derived from Doom v1.2, it does not feature an exception clause for projectiles in P_CrossSpecialLine, which means that every projectile or other moving actor (such as the explosive spore pods for instance) can trigger them. However, the set of line types affected is reduced to just three:

  • 4: W1 Door
  • 39: W1 Teleport
  • 97: WR Teleport

The lift types (10 and 88) are commented out, removed from the game; and the monster teleport types were added to the engine for Doom II and therefore were never present in the codebase that went into Heretic.

The bug does not exist in Hexen or Strife. Hexen uses a generalized system where line activation is disconnected from line special. Projectiles with the MF2_PCROSS flag are allowed to trigger lines that are set to be activated by projectile crossing. Strife uses an additional check that rejects missiles and corpses based on the MF_MISSILE and MF_CORPSE flags, except for line type 182: G1 Break Glass, where the ability to trigger the effect with a projectile is explicitly desired.