summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoman Tetelman <kevlarman@gmail.com>2009-10-03 12:04:52 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:15:39 +0000
commit30386f196338d06c92eee69abab009f368a63813 (patch)
treefaeab9b59e0664fb69cfde4da78bed2c495ea3ab /src
parent3b145e1bfc6ae872f6630d5601cc79206e7ba7a1 (diff)
* fix for aliens being unable to attack nodes from directly above
Diffstat (limited to 'src')
-rw-r--r--src/game/g_weapon.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c
index ae13d3ba..1edb5ccf 100644
--- a/src/game/g_weapon.c
+++ b/src/game/g_weapon.c
@@ -157,12 +157,17 @@ static void G_WideTrace( trace_t *tr, gentity_t *ent, float range,
VectorMA( muzzle, range, forward, end );
G_UnlaggedOn( ent, muzzle, range );
+
//prefer the target in the crosshairs
trap_Trace( tr, muzzle, NULL, NULL, end, ent->s.number, CONTENTS_BODY );
// Trace against entities
if( tr->entityNum == ENTITYNUM_NONE )
trap_Trace( tr, muzzle, mins, maxs, end, ent->s.number, CONTENTS_BODY );
+ else
+ //if the first trace hit, we need to set width to 0 to avoid
+ //"missing" in some rare cases
+ width = 0;
// If we started in a solid that means someone is within our muzzle box,
// the trace didn't give us the entity number though so do a trace
@@ -174,7 +179,6 @@ static void G_WideTrace( trace_t *tr, gentity_t *ent, float range,
if( tr->entityNum != ENTITYNUM_NONE )
*target = &g_entities[ tr->entityNum ];
}
-
else if( tr->entityNum != ENTITYNUM_NONE )
{
*target = &g_entities[ tr->entityNum ];