diff options
author | Paweł Redman <pawel.redman@gmail.com> | 2018-02-25 19:33:02 +0100 |
---|---|---|
committer | Paweł Redman <pawel.redman@gmail.com> | 2018-02-25 19:33:02 +0100 |
commit | 5a43e39113ce8d4ed07059ddc8807a0ade172fc7 (patch) | |
tree | eff719bb68ebf0c6786df6a064a607d31b7c4c59 /src/game | |
parent | 432e7bec6baa7470762c19adef584bbab244aaf5 (diff) |
Do a ray trace before a box sweep when testing for melee hits.melee-traces
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/g_weapon.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c index 8ab005e..5270339 100644 --- a/src/game/g_weapon.c +++ b/src/game/g_weapon.c @@ -239,7 +239,9 @@ void meleeAttack( gentity_t *ent, float range, float width, int damage, meansOfD VectorMA( muzzle, range, forward, end ); G_UnlaggedOn( ent, muzzle, range ); - trap_Trace( &tr, muzzle, mins, maxs, end, ent->s.number, MASK_SHOT ); + trap_Trace( &tr, muzzle, NULL, NULL, end, ent->s.number, MASK_SHOT ); + if( tr.entityNum == ENTITYNUM_NONE || tr.entityNum == ENTITYNUM_WORLD ) + trap_Trace( &tr, muzzle, mins, maxs, end, ent->s.number, MASK_SHOT ); G_UnlaggedOff( ); if( tr.surfaceFlags & SURF_NOIMPACT ) @@ -889,7 +891,9 @@ qboolean CheckVenomAttack( gentity_t *ent ) VectorMA( muzzle, LEVEL0_BITE_RANGE, forward, end ); G_UnlaggedOn( ent, muzzle, LEVEL0_BITE_RANGE ); - trap_Trace( &tr, muzzle, mins, maxs, end, ent->s.number, MASK_SHOT ); + trap_Trace( &tr, muzzle, NULL, NULL, end, ent->s.number, MASK_SHOT ); + if( tr.entityNum == ENTITYNUM_NONE || tr.entityNum == ENTITYNUM_WORLD ) + trap_Trace( &tr, muzzle, mins, maxs, end, ent->s.number, MASK_SHOT ); G_UnlaggedOff( ); if( tr.surfaceFlags & SURF_NOIMPACT ) |