summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIronClawTrem <louie.nutman@gmail.com>2020-03-19 22:40:50 +0000
committerIronClawTrem <louie.nutman@gmail.com>2020-03-19 22:40:50 +0000
commit18c5857b4d93230bd498e1a3da459bc86a39a3f4 (patch)
tree73a71d781a99805e0f5059a67fac6321250293ac
parent89b2db06fc43b8dbd5c737996055aad7d51bf27e (diff)
move teslaFire origin to shoot over turrets
-rw-r--r--src/game/g_weapon.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c
index 3f7c65b..00e8eab 100644
--- a/src/game/g_weapon.c
+++ b/src/game/g_weapon.c
@@ -695,12 +695,15 @@ TESLA GENERATOR
void teslaFire( gentity_t *ent )
{
trace_t tr;
- vec3_t end;
+ vec3_t end, origin;
gentity_t *traceEnt, *tent;
VectorMA( muzzle, TESLAGEN_RANGE, forward, end );
- trap_Trace( &tr, muzzle, NULL, NULL, end, ent->s.number, MASK_SHOT );
+ // Move the muzzle from the entity origin up a bit to fire over turrets
+ VectorMA( muzzle, ent->r.maxs[ 2 ], ent->s.origin2, origin );
+
+ trap_Trace( &tr, origin, NULL, NULL, end, ent->s.number, MASK_SHOT );
if( tr.entityNum == ENTITYNUM_NONE )
return;
@@ -732,9 +735,6 @@ void teslaFire( gentity_t *ent )
tent->s.generic1 = ent->s.number; //src
tent->s.clientNum = traceEnt->s.number; //dest
-
- // move origin a bit to come closer to the drawn gun muzzle
- VectorMA( tent->s.origin2, 28, up, tent->s.origin2 );
}