Lee Killough's page says that barrel suicide does not occur when the monster destroys the barrel with his first shot. Doesn't that imply that the one-line bug fix described here is not the whole story? Ryan W 02:40, 31 October 2006 (UTC)
Youtube video of a suicide Cacodemon http://www.youtube.com/watch?v=_slF2ne_drQ
Changes after testing
I removed a paragraph that said you could replicate the effect by giving a monster a blast damage attack. Not true; the monster gets hurt, but it does not become its own target. Also, I got a shotgun guy to hurt himself finally in E1M1, then he just walked around shooting as if he were blind, heh. A demo of a zombie doing this would be useful, though it's hard to get them to hurt themselves without destroying themselves, because of their low hit points. The task could be made easy by making a PWAD that places one at a certain distance from a Barrel it can't get closer to or farther from, with the player as a target beyond. In the process I noticed a v1.2 difference; shotgun guys don't light up when they fire. Who is like God? 09:03, 13 May 2008 (UTC)
Call for a rewrite
The entire article has to be rewritten, the current explanation is incorrect. This is how this bug operates in reality:
1) Monster X damages a barrel without actually exploding it 2) the barrel explodes (injuring Monster X), set off by a) another monster -> Monster X will attack it b) the player -> Monster X will (attempt to) attack itself c) Monster X -> same as b)
If a monster explodes a barrel that is at "full health", that monster will not (attempt to) attack itself.
Then there are issues with passages like When damaging another object as a result of the barrel explosion, the "source" of the explosion is then passed on to the damaged object. It's hard to discern what the italicized portion is trying to say. Needs to be reworded or rewritten.
Before I start editing, I'd like some input from programmers.
- Interesting! Your analysis seems to be correct (I tried myself). It actually seems to be quite difficult to trigger the barrel suicide phenomenon, as the monster needs to damage the barrel without making it explode, then hit the same barrel again. A lot of the time it just blows up on the first hit.
- The code fragment does seem to be correct, however. I made a modified version of Chocolate Doom where I removed the check, and the same behavior occurred.
- I'd guess that the barrel's "target" only gets set when it is damaged and not when it is immediately blown up, but I'd have to check the source in more detail to be certain. Fraggle 14:05, October 31, 2009 (UTC)