games/doom: add bug compatibility switches (thanks qu7uux)

these emulate bugs present in select versions of the released doom executables.
they are required to correctly play demos recorded with these but affect the
gameplay, so should be otherwise disabled.

-nobounce: lost souls don't bounce off floors and ceilings like intended due
to a misplaced check; this is fixed from ultimate doom on, but doom and doom2
are still affected.

-noztele: in final doom 1.9, things' altitude was erroneously not set to the
floor's height after teleporting. this was fixed in later versions of the
executables.

examples of desyncing demos:
(plutonia.wad, without -noztele) http://doomedsda.us/lmps/946/2/30pl2646.zip
(doom2.wad, without -nobounce) http://doomedsda.us/lmps/945/3/30nm2939.zip
This commit is contained in:
cinap_lenrek 2015-07-30 19:55:13 +02:00
parent f899b2fe3c
commit b579acef97
4 changed files with 16 additions and 6 deletions

View file

@ -90,6 +90,9 @@ boolean drone;
boolean singletics = false; // debug flag to cancel adaptiveness
/* bug compatibility with various versions of doom */
boolean noztele;
boolean nobounce;
//extern int soundVolume;
@ -736,6 +739,10 @@ void D_DoomMain (void)
respawnparm = M_CheckParm ("-respawn");
fastparm = M_CheckParm ("-fast");
devparm = M_CheckParm ("-devparm");
if (M_CheckParm ("-noztele") && gamemode == commercial)
noztele = 1;
if (M_CheckParm ("-nobounce") && (gamemode == commercial || gamemode == registered))
nobounce = 1;
if (M_CheckParm ("-altdeath"))
deathmatch = 2;
else if (M_CheckParm ("-deathmatch"))

View file

@ -60,6 +60,8 @@
// follow a player exlusively for 3 seconds
#define BASETHRESHOLD 100
extern boolean noztele;
extern boolean nobounce;
//

View file

@ -285,10 +285,7 @@ void P_ZMovement (mobj_t* mo)
{
// hit the floor
// Note (id):
// somebody left this after the setting momz to 0,
// kinda useless there.
if (mo->flags & MF_SKULLFLY)
if (!nobounce && mo->flags & MF_SKULLFLY)
{
// the skull slammed into something
mo->momz = -mo->momz;
@ -310,6 +307,9 @@ void P_ZMovement (mobj_t* mo)
}
mo->z = mo->floorz;
if (nobounce && mo->flags & MF_SKULLFLY)
mo->momz = -mo->momz;
if ( (mo->flags & MF_MISSILE)
&& !(mo->flags & MF_NOCLIP) )
{

View file

@ -102,7 +102,8 @@ EV_Teleport
if (!P_TeleportMove (thing, m->x, m->y))
return 0;
thing->z = thing->floorz; //fixme: not needed?
if(!noztele)
thing->z = thing->floorz;
if (thing->player)
thing->player->viewz = thing->z+thing->player->viewheight;