summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2015-03-14 23:31:46 +0100
committerPaweł Redman <pawel.redman@gmail.com>2015-03-14 23:31:46 +0100
commit8b72548e0448907f972c5b9b810cde2950ce1fac (patch)
tree01cfbd67a3e74681dc3b370b7b601b1ddcd7dd33
parenta3a89848ab31a43b174fb729c8af8117028ff7db (diff)
Fix a bug in Hummel's firing code.
-rw-r--r--src/game/g_missile.c3
-rw-r--r--src/game/g_weapon.c12
2 files changed, 8 insertions, 7 deletions
diff --git a/src/game/g_missile.c b/src/game/g_missile.c
index 46f61af..e627f14 100644
--- a/src/game/g_missile.c
+++ b/src/game/g_missile.c
@@ -1694,8 +1694,7 @@ for Hummel's second mode
gentity_t *Prickles_Fire( gentity_t *self, vec3_t start, vec3_t dir )
{
gentity_t *bolt;
- VectorNormalize ( dir );
-
+
bolt = G_Spawn( );
bolt->classname = "prickles";
bolt->pointAgainstWorld = qtrue;
diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c
index 58432d7..3a8c8ac 100644
--- a/src/game/g_weapon.c
+++ b/src/game/g_weapon.c
@@ -1837,7 +1837,7 @@ LEVEL5
void Prickles( gentity_t *ent )
{
- vec3_t end;
+ vec3_t dir;
float r;
float u;
@@ -1846,11 +1846,13 @@ void Prickles( gentity_t *ent )
r = random( ) * M_PI * 2.0f;
u = sin( r ) * crandom( ) * LEVEL5_PRICKLES_SPREAD * 16;
r = cos( r ) * crandom( ) * LEVEL5_PRICKLES_SPREAD * 16;
- VectorMA( muzzle, 8192 * 16, forward, end );
- VectorMA( end, r, right, end );
- VectorMA( end, u, up, end );
- Prickles_Fire( ent, muzzle, end );
+ VectorScale( forward, 8192 * 16, dir );
+ VectorMA( dir, r, right, dir );
+ VectorMA( dir, u, up, dir );
+ VectorNormalize( dir );
+
+ Prickles_Fire( ent, muzzle, dir );
}