summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJames Haley2010-09-05 05:51:38 +0000
committerJames Haley2010-09-05 05:51:38 +0000
commit9efed5192aeb52379a8bfc66cde3b773b1bcb681 (patch)
tree6bb8ea2df6cb096f37e7ff9c7a88afb56784dcfa /src
parent289ae90614062bf5ab367a1befcec98ab99e7094 (diff)
downloadchocolate-doom-9efed5192aeb52379a8bfc66cde3b773b1bcb681.tar.gz
chocolate-doom-9efed5192aeb52379a8bfc66cde3b773b1bcb681.tar.bz2
chocolate-doom-9efed5192aeb52379a8bfc66cde3b773b1bcb681.zip
Remove an order-of-evaluation dependency with respect to P_Random().
Subversion-branch: /branches/strife-branch Subversion-revision: 2012
Diffstat (limited to 'src')
-rw-r--r--src/strife/p_pspr.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/src/strife/p_pspr.c b/src/strife/p_pspr.c
index 8d0940ce..6696e153 100644
--- a/src/strife/p_pspr.c
+++ b/src/strife/p_pspr.c
@@ -654,13 +654,13 @@ void P_BulletSlope (mobj_t* mo)
if (!linetarget)
{
- an += 1<<26;
- bulletslope = P_AimLineAttack (mo, an, 16*64*FRACUNIT);
- if (!linetarget)
- {
- an -= 2<<26;
- bulletslope = P_AimLineAttack (mo, an, 16*64*FRACUNIT);
- }
+ an += 1<<26;
+ bulletslope = P_AimLineAttack (mo, an, 16*64*FRACUNIT);
+ if (!linetarget)
+ {
+ an -= 2<<26;
+ bulletslope = P_AimLineAttack (mo, an, 16*64*FRACUNIT);
+ }
}
}
@@ -668,20 +668,26 @@ void P_BulletSlope (mobj_t* mo)
//
// P_GunShot
//
+// [STRIFE] Modifications to support accuracy.
+//
void
P_GunShot
( mobj_t* mo,
boolean accurate )
{
- angle_t angle;
- int damage;
-
+ angle_t angle;
+ int damage;
+ int t;
+
damage = 4*(P_Random ()%3+4); // villsa [STRIFE] different damage formula
angle = mo->angle;
// villsa [STRIFE] apply player accuracy
if (!accurate)
- angle += (P_Random()-P_Random())<<(20 - (mo->player->accuracy * 4 / 100));
+ {
+ t = P_Random();
+ angle += (t - P_Random())<<(20 - (mo->player->accuracy * 4 / 100));
+ }
P_LineAttack (mo, angle, MISSILERANGE, bulletslope, damage);
}