diff --git a/Source/p_doors.c b/Source/p_doors.c index 13748b73..88812735 100644 --- a/Source/p_doors.c +++ b/Source/p_doors.c @@ -449,9 +449,18 @@ int EV_VerticalDoor(line_t *line, mobj_t *thing) sec = sides[line->sidenum[1]].sector; // if door already has a thinker, use it - if (sec->ceilingdata) //jff 2/22/98 + door = sec->ceilingdata; //jff 2/22/98 + + // [FG] DR doors corrupt other actions + // http://prboom.sourceforge.net/mbf-bugs.html + if (demo_compatibility) + { + if (!door) door = sec->floordata; + if (!door) door = sec->lightingdata; + } + + if (door) //jff 2/22/98 { - door = sec->ceilingdata; //jff 2/22/98 switch(line->special) { case 1: // only for "raise" doors, not "open"s @@ -466,7 +475,21 @@ int EV_VerticalDoor(line_t *line, mobj_t *thing) if (!thing->player) return 0; // JDC: bad guys never close doors + // [FG] DR doors corrupt other actions + // http://prboom.sourceforge.net/mbf-bugs.html + if (door->thinker.function == T_VerticalDoor || !demo_compatibility) + { door->direction = -1; // start going down immediately + } + else if (door->thinker.function == T_PlatRaise) + { + plat_t *plat = (plat_t *) door; + plat->wait = -1; + } + else + { + door->direction = -1; + } } return 1; } diff --git a/Source/p_floor.c b/Source/p_floor.c index a8a9dcbc..0fd9df51 100644 --- a/Source/p_floor.c +++ b/Source/p_floor.c @@ -692,6 +692,24 @@ int EV_DoChange // Returns true if any thinkers are created // +// [FG] Compatibility bug in EV_BuildStairs +// http://prboom.sourceforge.net/mbf-bugs.html + +static int P_FindSectorFromLineTag_Vanilla (const line_t* line, int start) +{ + int i; + + for (i=start+1;itag) + return i; + + return -1; +} + +int (*P_FindSectorFromLineTag_BuildStairs)(const line_t* line, int start); + +#define STAIRS_UNINITIALIZED_CRUSH_FIELD_VALUE 10 + int EV_BuildStairs ( line_t* line, stair_e type ) @@ -716,8 +734,14 @@ int EV_BuildStairs secnum = -1; rtn = 0; +// [FG] Compatibility bug in EV_BuildStairs +// http://prboom.sourceforge.net/mbf-bugs.html + P_FindSectorFromLineTag_BuildStairs = demo_compatibility ? + P_FindSectorFromLineTag_Vanilla : + P_FindSectorFromLineTag; + // start a stair at each sector tagged the same as the linedef - while ((secnum = P_FindSectorFromLineTag(line,secnum)) >= 0) + while ((secnum = P_FindSectorFromLineTag_BuildStairs(line,secnum)) >= 0) { sec = §ors[secnum]; @@ -744,12 +768,18 @@ int EV_BuildStairs stairsize = 8*FRACUNIT; if (!demo_compatibility) floor->crush = false; //jff 2/27/98 fix uninitialized crush field + // [FG] initialize crush field + else + floor->crush = STAIRS_UNINITIALIZED_CRUSH_FIELD_VALUE; break; case turbo16: speed = FLOORSPEED*4; stairsize = 16*FRACUNIT; if (!demo_compatibility) floor->crush = true; //jff 2/27/98 fix uninitialized crush field + // [FG] initialize crush field + else + floor->crush = STAIRS_UNINITIALIZED_CRUSH_FIELD_VALUE; break; } floor->speed = speed; @@ -809,12 +839,17 @@ int EV_BuildStairs //jff 2/27/98 fix uninitialized crush field if (!demo_compatibility) floor->crush = type==build8? false : true; + // [FG] initialize crush field + else + floor->crush = STAIRS_UNINITIALIZED_CRUSH_FIELD_VALUE; ok = 1; break; } } while(ok); // continue until no next step is found - if (!comp[comp_stairs]) // killough 10/98: compatibility option + // [FG] Compatibility bug in EV_BuildStairs + // http://prboom.sourceforge.net/mbf-bugs.html + if (!comp[comp_stairs] && !demo_compatibility) // killough 10/98: compatibility option secnum = osecnum; //jff 3/4/98 restore loop index } return rtn;