foxygit / doom Log in
commit 25e014bf2602d3f145da54a9329854aa615a3f75
Author:     James Haley <haleyjd@hotmail.com>
AuthorDate: Mon Sep 6 22:13:13 2010 +0000
Commit:     James Haley <haleyjd@hotmail.com>
CommitDate: Mon Sep 6 22:13:13 2010 +0000

    Fixes to Inquisitor grenades, Loremaster hookshot spawn, and
    P_SpawnFacingMissile.

    Subversion-branch: /branches/strife-branch
    Subversion-revision: 2024
---
 src/strife/p_enemy.c |  2 +-
 src/strife/p_mobj.c  | 16 +++++++++++-----
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/src/strife/p_enemy.c b/src/strife/p_enemy.c
index e62f6bd6..e7de0dbd 100644
--- a/src/strife/p_enemy.c
+++ b/src/strife/p_enemy.c
@@ -2054,7 +2054,7 @@ void A_FireChainShot(mobj_t* actor)
 {
     S_StartSound(actor, sfx_tend);

-    P_SpawnMobj(actor->x, actor->y, actor->z, actor->z);
+    P_SpawnMobj(actor->x, actor->y, actor->z, MT_CHAINSHOT); // haleyjd: fixed type

     P_SpawnMobj(actor->x - (actor->momx >> 1),
         actor->y - (actor->momy >> 1),
diff --git a/src/strife/p_mobj.c b/src/strife/p_mobj.c
index a40e2e63..70907fb6 100644
--- a/src/strife/p_mobj.c
+++ b/src/strife/p_mobj.c
@@ -1134,16 +1134,22 @@ mobj_t* P_SpawnFacingMissile(mobj_t* source, mobj_t* target, mobjtype_t type)
         S_StartSound(th, th->info->seesound);

     th->target = source;    // where it came from
+    th->angle = source->angle; // haleyjd 09/06/10: fix0red
     an = th->angle;

     // fuzzy player
     if (target->flags & MF_SHADOW)
-	an += (P_Random()-P_Random())<<21;
+    {
+        int t = P_Random();
+        an += (t - P_Random()) << 21;
+    }
     // villsa [STRIFE] check for heavily transparent things
     else if(target->flags & MF_MVIS)
-        an += (P_Random()-P_Random())<<22;
+    {
+        int t = P_Random();
+        an += (t - P_Random()) << 22;
+    }

-    th->angle = an;
     an >>= ANGLETOFINESHIFT;
     th->momx = FixedMul (th->info->speed, finecosine[an]);
     th->momy = FixedMul (th->info->speed, finesine[an]);
@@ -1250,8 +1256,8 @@ mobj_t* P_SpawnMortar(mobj_t *source, mobjtype_t type)

     slope = P_AimLineAttack(source, source->angle, 1024*FRACUNIT);

-    th->momx = FixedMul (th->info->speed, finecosine[an]);
-    th->momy = FixedMul (th->info->speed, finesine[an]);
+    th->momx = FixedMul(th->info->speed, finecosine[an]);
+    th->momy = FixedMul(th->info->speed, finesine[an]);
     th->momz = FixedMul(th->info->speed, slope);

     P_CheckMissileSpawn(th);