From 18c5857b4d93230bd498e1a3da459bc86a39a3f4 Mon Sep 17 00:00:00 2001 From: IronClawTrem Date: Thu, 19 Mar 2020 22:40:50 +0000 Subject: move teslaFire origin to shoot over turrets --- src/game/g_weapon.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/game') 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 ); } -- cgit