From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-io0-f174.google.com ([209.85.223.174]) by ur; Wed Jul 29 12:08:05 EDT 2015 Received: by iodd187 with SMTP id d187so26227709iod.2 for <9front@9front.org>; Wed, 29 Jul 2015 09:08:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=KIH/nLfGQXYTBMo5Gr0Tl6goxjes7/1AI8+1Wz1bWRc=; b=bynVsnLkNiMsreE+yuFMpy24jehoOUhdC14owuZsOXl4RIBMQyAU6WqiElxPmeow9Q YN6SgCnHURDWv+TBzk4EMTygKZl4S/9bODRmn6CDoHIHRos6rUxXMJ45ZFZwJI/f5Dfw N30s6MbOj/893ufMLvGaVXQCC5PjHOBF+itJeL0aoTiX5GjJcEPtTiaTlfyzosS+iWCz eoN2yN7WSGhI4eR21BdgzOqEXlUkMR3js5ImDK38qqNfU9BArw9z9enTwsY0D5bAeeuv Ech+6DsC95PUvfvk/ioBiyfLxQBhf5Km94fK+UHfgACYpU9gSN+3B/wY+hEJs+U81KxC /Iug== MIME-Version: 1.0 X-Received: by 10.107.5.149 with SMTP id 143mr3186952iof.109.1438186082822; Wed, 29 Jul 2015 09:08:02 -0700 (PDT) Received: by 10.107.56.68 with HTTP; Wed, 29 Jul 2015 09:08:02 -0700 (PDT) Date: Wed, 29 Jul 2015 19:08:02 +0300 Message-ID: List-ID: <9front.9front.org> X-Glyph: ➈ X-Bullshit: object-oriented structured just-in-time element descriptor Subject: games/doom: add bug compatibility switches From: qux To: 9front@9front.org Content-Type: text/plain; charset=UTF-8 games/doom: add bug compatibility switches 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 diff -r aa2b4dca05f1 sys/src/games/doom/d_main.c --- a/sys/src/games/doom/d_main.c Wed Jul 29 14:51:00 2015 +0200 +++ b/sys/src/games/doom/d_main.c Wed Jul 29 17:47:53 2015 +0300 @@ -90,6 +90,9 @@ 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 @@ 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")) diff -r aa2b4dca05f1 sys/src/games/doom/p_local.h --- a/sys/src/games/doom/p_local.h Wed Jul 29 14:51:00 2015 +0200 +++ b/sys/src/games/doom/p_local.h Wed Jul 29 17:47:53 2015 +0300 @@ -60,6 +60,8 @@ // follow a player exlusively for 3 seconds #define BASETHRESHOLD 100 +extern boolean noztele; +extern boolean nobounce; // diff -r aa2b4dca05f1 sys/src/games/doom/p_mobj.c --- a/sys/src/games/doom/p_mobj.c Wed Jul 29 14:51:00 2015 +0200 +++ b/sys/src/games/doom/p_mobj.c Wed Jul 29 17:47:53 2015 +0300 @@ -285,10 +285,7 @@ { // 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 @@ } mo->z = mo->floorz; + if (nobounce && mo->flags & MF_SKULLFLY) + mo->momz = -mo->momz; + if ( (mo->flags & MF_MISSILE) && !(mo->flags & MF_NOCLIP) ) { diff -r aa2b4dca05f1 sys/src/games/doom/p_telept.c --- a/sys/src/games/doom/p_telept.c Wed Jul 29 14:51:00 2015 +0200 +++ b/sys/src/games/doom/p_telept.c Wed Jul 29 17:47:53 2015 +0300 @@ -101,8 +101,9 @@ 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;