There are actually 2 bugs at work here:
This code in P_CeilingRaise is responsible for the gib moving up while the door raises:
Code: Select all
else if (!isgood && thing->z + thing->height < thing->ceilingz )
{
if (!P_TestMobjZ (thing) && onmobj->z <= thing->z)
{
thing->z = MIN (thing->ceilingz - thing->height,
onmobj->z + onmobj->height);
}
}
The gib on the right side on the inside of the door overlaps with the torch nearby. So while raising the door the code tries to put the gib at the highest possible position below its 'floor' (the top of the torch). The problem is that this code only makes sense for objects which have the MF2_PASSMOBJ flag set. For decorations (especially non-solid ones) it should never be executed.
The second effect (The gib jumping up while the door is moving down) is caused by the following incorrect check in P_PushDown:
Code: Select all
if (thing->z < thing->floorz)
{
return 1;
}
It should be '<=' instead of '<'.
Anyway, P_PushDown should always check whether the z-position it wants to place an object in is actually lower than its current z-position. It doesn't do that either.