So, confirmation that in vanilla the ceiling stops 8 units above the floor:
Code: Select all
case crushAndRaise:
ceiling->crush = true;
ceiling->topheight = sec->ceilingheight;
case lowerAndCrush:
case lowerToFloor:
ceiling->bottomheight = sec->floorheight;
if (type != lowerToFloor)
ceiling->bottomheight += 8*FRACUNIT;
ceiling->direction = -1;
ceiling->speed = CEILSPEED;
break;
See how there's no break after the case crushAndRaise: block, so it continues to the case lowerToFloor: block where it gets a bottomheight increased by 8 units.
Same deal in Heretic, except here we start from case lowerAndCrush: so it doesn't get crush set to true and it doesn't get the topheight set.
Code: Select all
case crushAndRaise:
ceiling->crush = true;
ceiling->topheight = sec->ceilingheight;
case lowerAndCrush:
case lowerToFloor:
ceiling->bottomheight = sec->floorheight;
if (type != lowerToFloor)
ceiling->bottomheight += 8*FRACUNIT;
ceiling->direction = -1;
ceiling->speed = CEILSPEED;
break;
In order to get that working in ZDoom, I made the following adjustments:
1. Hacked the crushmode parameter for Ceiling_CrushAndRaiseA, in this way:
Code: Select all
FUNC(LS_Ceiling_CrushAndRaiseA)
// Ceiling_CrushAndRaiseA (tag, dnspeed, upspeed, damage, crushtype)
{
return EV_DoCeiling (DCeiling::ceilCrushAndRaise, ln, arg0, SPEED(arg1), SPEED(arg2), arg4&0x80?8:0, arg3, 0, 0, CRUSHTYPE(arg4&3));
}
So if the crushmode parameter has the MSB set (value 128), then EV_DoCeiling is given a height of 8. Crushmode is &ed with 3 so as not to affect its normal operation. This was needed because there was no more room for additional parameters for this function, and crushmode is the closest to a flag parameter.
Then base xlat has the relevant line changed to this:
49 = USE, Ceiling_CrushAndRaiseA (tag, C_SLOW, C_SLOW, 10, 128)
For Heretic, this line is added:
49 = USE, Ceiling_LowerAndCrush (tag, C_SLOW, 0, 2)
For Strife, the line is changed as such:
49 = USE, Ceiling_CrushAndRaiseA (tag, C_SLOW, C_SLOW, 0, 130)
This gets vanilla-accurate behavior for all three games.