Timebeforeexit
Member of the player struct; timebeforeexit is a non-zero count-down timer. At one, all players are set to end of level mode (.gm) (MODE_EOL) and the next level number is set.
The value of the timer is at 0 during level start, but after EOL triggered, it jumps to the predefined variable (for example "endofgame 52" on BOSS1 sets it to 52) and starts counting down to 1.
If this was triggered with endofgame, and you manually intervene by setting the player struct member gm to 8, the game still ends the whole episode, instead of just the level.