Take a look at this shot:
http://www.btinternet.com/~chapterhonour/fiendbug.jpg
How did the fiend end up through the wall, so high up in Gloom Keep?
The eagle-eyed might have spotted the alteration I alluded to above, it was a setorigin call in demon1_jump4. Nobody saw that? Fair enough...
You might be thinking that I was trying to sneak Lunaran's 16 unit lifting fix into the mix as well. Actually, the code that lifts the fiend 1 unit off the ground is in the original ID source, but they do it as:
self.origin_z = self.origin_z + 1;
This is bad practice, as you aren't meant to set the origin of an object without calling setorigin(but you can get away with it if the object isn't solid yet). So I thought I was fixing a bug.
It turns out I
was fixing a bug after a fashion, but only in the sense that the original line is a bug, and the fixed line is a bug with the proper function call. Because there's no checking for low ceilings when the line is called, the fiend can be bumped up into a stuck position.
It's not easy to do this, as quake monsters won't walk into a place where there's no clearance between the top of their bbox and the ceiling above them. Due to grid snapping, you need to use sloping surfaces to make the gap smaller than 1 unit. The small doorway below the fiend in the screenshot offers one such place, as the doorway has 45 degree bevels at the top. If you jam the fiend into the doorway and make it leap into the door frame enough times, eventually it'll do it close enough to get stuck. The 1 unit bump
just moves its bounding box into the sloped roof of the doorway.
Then once the fiend is stuck, it tries to jump its way free. Each jump it tries to make begins with the 1 unit bump, so it gets stuck further. If you go away and do the crossword for a bit, the end result is what you see in the screenshot.
Now, I believe I'm right in saying that the line should just be commented out, because lifting the fiend off the ground like that is unnecessary. From trial runs, the fiend certainly jumps just like before. Unless someone can suggest a more unusual case when the height bump is needed, I think the line only causes the occasional bug.