ref: 31e5261c981d89b2e83191c01e57a252cd94f2ae
parent: f3904bd8d42f662436a204a3e73a0d2a0091899f
author: Simon Howard <[email protected]>
date: Wed Nov 27 21:50:45 EST 2013
Fix Heretic demo desync caused by r1228 (thanks marineController). Subversion-branch: /branches/v2-branch Subversion-revision: 2755
--- a/src/heretic/p_pspr.c
+++ b/src/heretic/p_pspr.c
@@ -1070,9 +1070,17 @@
}
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;
--- a/src/heretic/p_user.c
+++ b/src/heretic/p_user.c
@@ -988,11 +988,18 @@
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;