summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2018-02-25 19:33:02 +0100
committerPaweł Redman <pawel.redman@gmail.com>2018-02-25 19:33:02 +0100
commit5a43e39113ce8d4ed07059ddc8807a0ade172fc7 (patch)
treeeff719bb68ebf0c6786df6a064a607d31b7c4c59 /src/game
parent432e7bec6baa7470762c19adef584bbab244aaf5 (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.c8
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 )