summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Howard2013-11-28 02:50:45 +0000
committerSimon Howard2013-11-28 02:50:45 +0000
commit31e5261c981d89b2e83191c01e57a252cd94f2ae (patch)
tree2c1a8e549459c607fa8561154a5910c103d41888 /src
parentf3904bd8d42f662436a204a3e73a0d2a0091899f (diff)
downloadchocolate-doom-31e5261c981d89b2e83191c01e57a252cd94f2ae.tar.gz
chocolate-doom-31e5261c981d89b2e83191c01e57a252cd94f2ae.tar.bz2
chocolate-doom-31e5261c981d89b2e83191c01e57a252cd94f2ae.zip
Fix Heretic demo desync caused by r1228 (thanks marineController).
Subversion-branch: /branches/v2-branch Subversion-revision: 2755
Diffstat (limited to 'src')
-rw-r--r--src/heretic/p_pspr.c12
-rw-r--r--src/heretic/p_user.c11
2 files changed, 19 insertions, 4 deletions
diff --git a/src/heretic/p_pspr.c b/src/heretic/p_pspr.c
index c0abf559..66f50ef3 100644
--- a/src/heretic/p_pspr.c
+++ b/src/heretic/p_pspr.c
@@ -1070,9 +1070,17 @@ void A_FireMacePL1B(player_t * player, pspdef_t * psp)
}
player->ammo[am_mace] -= USE_MACE_AMMO_1;
pmo = player->mo;
+
+ // Vanilla bug here:
+ // Original code here looks like:
+ // (pmo->flags2 & MF2_FEETARECLIPPED != 0)
+ // C's operator precedence interprets this as:
+ // (pmo->flags2 & (MF2_FEETARECLIPPED != 0))
+ // Which simplifies to:
+ // (pmo->flags2 & 1)
ball = P_SpawnMobj(pmo->x, pmo->y, pmo->z + 28 * FRACUNIT
- - FOOTCLIPSIZE * ((pmo->flags2 & MF2_FEETARECLIPPED) !=
- 0), MT_MACEFX2);
+ - FOOTCLIPSIZE * (pmo->flags2 & 1), MT_MACEFX2);
+
ball->momz = 2 * FRACUNIT + ((player->lookdir) << (FRACBITS - 5));
angle = pmo->angle;
ball->target = pmo;
diff --git a/src/heretic/p_user.c b/src/heretic/p_user.c
index 79620630..4c9ae4c6 100644
--- a/src/heretic/p_user.c
+++ b/src/heretic/p_user.c
@@ -988,11 +988,18 @@ boolean P_UseArtifact(player_t * player, artitype_t arti)
break;
case arti_firebomb:
angle = player->mo->angle >> ANGLETOFINESHIFT;
+
+ // Vanilla bug here:
+ // Original code here looks like:
+ // (player->mo->flags2 & MF2_FEETARECLIPPED != 0),
+ // Which under C's operator precedence is:
+ // (player->mo->flags2 & (MF2_FEETARECLIPPED != 0)),
+ // Which simplifies to:
+ // (player->mo->flags2 & 1),
mo = P_SpawnMobj(player->mo->x + 24 * finecosine[angle],
player->mo->y + 24 * finesine[angle],
player->mo->z -
- 15 * FRACUNIT *
- (player->mo->flags2 & MF2_FEETARECLIPPED) != 0,
+ 15 * FRACUNIT * (player->mo->flags2 & 1),
MT_FIREBOMB);
mo->target = player->mo;
break;