diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game/g_weapon.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c index 82bad26..2cb91d5 100644 --- a/src/game/g_weapon.c +++ b/src/game/g_weapon.c @@ -176,19 +176,17 @@ static void G_WideTrace( trace_t *tr, gentity_t *ent, float range, float width, // Trace against entities trap_Trace( tr, muzzle, mins, maxs, end, ent->s.number, CONTENTS_BODY ); if( tr->entityNum != ENTITYNUM_NONE ) - { *target = &g_entities[ tr->entityNum ]; - // Set range to the trace length plus the width, so that the end of the - // LOS trace is close to the exterior of the target's bounding box - range = Distance( muzzle, tr->endpos ) + width; - VectorMA( muzzle, range, forward, end ); + // Set range to the trace length plus the width, so that the end of the + // LOS trace is close to the exterior of the target's bounding box + range = Distance( muzzle, tr->endpos ) + width; + VectorMA( muzzle, range, forward, end ); - // Trace for line of sight against the world - trap_Trace( tr, muzzle, NULL, NULL, end, 0, CONTENTS_SOLID ); - if( tr->fraction < 1.0f ) - *target = NULL; - } + // Trace for line of sight against the world + trap_Trace( tr, muzzle, NULL, NULL, end, ent->s.number, CONTENTS_SOLID ); + if( tr->entityNum != ENTITYNUM_NONE ) + *target = &g_entities[ tr->entityNum ]; G_UnlaggedOff( ); } |