diff --git a/Source/p_floor.c b/Source/p_floor.c index 481ad81d..a8a9dcbc 100644 --- a/Source/p_floor.c +++ b/Source/p_floor.c @@ -95,6 +95,17 @@ result_e T_MovePlane lastpos = sector->floorheight; sector->floorheight -= speed; flag = P_CheckSector(sector,crush); //jff 3/19/98 use faster chk + + // [FG] Compatibility bug in T_MovePlane + // http://prboom.sourceforge.net/mbf-bugs.html + if ((flag == true) && demo_compatibility) + { + extern boolean P_ChangeSector(sector_t *sector,boolean crunch); + + sector->floorheight = lastpos; + P_ChangeSector(sector,crush); + return crushed; + } } break; diff --git a/Source/p_map.c b/Source/p_map.c index 2dae9990..bead80d4 100644 --- a/Source/p_map.c +++ b/Source/p_map.c @@ -1201,7 +1201,9 @@ void P_SlideMove(mobj_t *mo) if (!P_TryMove(mo, mo->x, mo->y + mo->momy, true)) if (!P_TryMove(mo, mo->x + mo->momx, mo->y, true)) - if (demo_version < 203 && !compatibility) + // [FG] Compatibility bug in P_SlideMove + // http://prboom.sourceforge.net/mbf-bugs.html + if (demo_version == 201) mo->momx = mo->momy = 0; break; @@ -1759,7 +1761,9 @@ static boolean PIT_ChangeSector(mobj_t *thing) // // P_ChangeSector // -static boolean P_ChangeSector(sector_t *sector,boolean crunch) +// [FG] Compatibility bug in T_MovePlane +// http://prboom.sourceforge.net/mbf-bugs.html +boolean P_ChangeSector(sector_t *sector,boolean crunch) { int x, y; @@ -2006,6 +2010,12 @@ void P_CreateSecNodeList(mobj_t *thing,fixed_t x,fixed_t y) int xl, xh, yl, yh, bx, by; msecnode_t *node; + // [FG] Overlapping uses of global variables in p_map.c + // http://prboom.sourceforge.net/mbf-bugs.html + mobj_t* saved_tmthing = tmthing; + int saved_tmflags = tmflags; + fixed_t saved_tmx = tmx, saved_tmy = tmy; + // First, clear out the existing m_thing fields. As each node is // added or verified as needed, m_thing will be set properly. When // finished, delete all nodes where m_thing is still NULL. These @@ -2052,6 +2062,23 @@ void P_CreateSecNodeList(mobj_t *thing,fixed_t x,fixed_t y) } else node = node->m_tnext; + + // [FG] Overlapping uses of global variables in p_map.c + // http://prboom.sourceforge.net/mbf-bugs.html + if (demo_compatibility) + { + tmthing = saved_tmthing; + tmflags = saved_tmflags; + tmx = saved_tmx; + tmy = saved_tmy; + if (tmthing) + { + tmbbox[BOXTOP] = tmy + tmthing->radius; + tmbbox[BOXBOTTOM] = tmy - tmthing->radius; + tmbbox[BOXRIGHT] = tmx + tmthing->radius; + tmbbox[BOXLEFT] = tmx - tmthing->radius; + } + } } //---------------------------------------------------------------------------- diff --git a/Source/p_sight.c b/Source/p_sight.c index 06e87d9a..48c0e8e3 100644 --- a/Source/p_sight.c +++ b/Source/p_sight.c @@ -26,6 +26,7 @@ // //----------------------------------------------------------------------------- +#include "doomstat.h" #include "r_main.h" #include "p_maputl.h" #include "p_setup.h" @@ -111,11 +112,16 @@ static boolean P_CrossSubsector(int num, register los_t *los) // OPTIMIZE: killough 4/20/98: Added quick bounding-box rejection test + // [FG] Compatibility bug in P_CrossSubsector + // http://prboom.sourceforge.net/mbf-bugs.html + if (!demo_compatibility) + { if (line->bbox[BOXLEFT ] > los->bbox[BOXRIGHT ] || line->bbox[BOXRIGHT ] < los->bbox[BOXLEFT ] || line->bbox[BOXBOTTOM] > los->bbox[BOXTOP ] || line->bbox[BOXTOP] < los->bbox[BOXBOTTOM]) continue; + } v1 = line->v1; v2 = line->v2; @@ -242,7 +248,9 @@ boolean P_CheckSight(mobj_t *t1, mobj_t *t2) return false; // killough 11/98: shortcut for melee situations - if (t1->subsector == t2->subsector) // same subsector? obviously visible + // [FG] Compatibility bug in P_CheckSight + // http://prboom.sourceforge.net/mbf-bugs.html + if (t1->subsector == t2->subsector && !demo_compatibility) // same subsector? obviously visible return true; // An unobstructed LOS is possible. diff --git a/Source/p_user.c b/Source/p_user.c index d0b4ce0b..616dfb16 100644 --- a/Source/p_user.c +++ b/Source/p_user.c @@ -100,8 +100,13 @@ void P_CalcHeight (player_t* player) // it causes bobbing jerkiness when the player moves from ice to non-ice, // and vice-versa. - player->bob = player_bobbing ? (FixedMul(player->momx,player->momx) + - FixedMul(player->momy,player->momy))>>2 : 0; + // [FG] MBF player bobbing rewrite causes demo sync problems + // http://prboom.sourceforge.net/mbf-bugs.html + player->bob = demo_compatibility ? + (FixedMul (player->mo->momx, player->mo->momx) + + FixedMul (player->mo->momy,player->mo->momy))>>2 : + player_bobbing ? (FixedMul(player->momx,player->momx) + + FixedMul(player->momy,player->momy))>>2 : 0; if (player->bob > MAXBOB) player->bob = MAXBOB; diff --git a/Source/wi_stuff.c b/Source/wi_stuff.c index 51e02ffe..4f03a54c 100644 --- a/Source/wi_stuff.c +++ b/Source/wi_stuff.c @@ -1389,7 +1389,9 @@ static void WI_updateNetgameStats(void) // killough 2/22/98: Make secrets = 100% if maxsecret = 0: - if (cnt_secret[i] >= (wbs->maxsecret ? (plrs[i].ssecret * 100) / wbs->maxsecret : 100)) + // [FG] Intermission screen secrets desync + // http://prboom.sourceforge.net/mbf-bugs.html + if (cnt_secret[i] >= (wbs->maxsecret ? (plrs[i].ssecret * 100) / wbs->maxsecret : demo_compatibility ? 0 : 100)) cnt_secret[i] = wbs->maxsecret ? (plrs[i].ssecret * 100) / wbs->maxsecret : 100; else stillticking = true; @@ -1598,7 +1600,10 @@ static void WI_updateStats(void) S_StartSound(0, sfx_pistol); // killough 2/22/98: Make secrets = 100% if maxsecret = 0: - if (cnt_secret[0] >= (wbs->maxsecret ? + // [FG] Intermission screen secrets desync + // http://prboom.sourceforge.net/mbf-bugs.html + if ((!wbs->maxsecret && demo_compatibility) || + cnt_secret[0] >= (wbs->maxsecret ? (plrs[me].ssecret * 100) / wbs->maxsecret : 100)) { cnt_secret[0] = (wbs->maxsecret ?