diff options
author | Christopher Schwarz <lakitu7@gmail.com> | 2011-07-31 00:33:55 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-01-03 00:18:09 +0000 |
commit | d3b1c0211dc818dfe5a8fbe37bb055b6256e8396 (patch) | |
tree | 29801899c306aa176f6ab975a19e44672d43e72d /src/game/g_weapon.c | |
parent | 6e88c4903cce13a3e8399d5939811a6abadf4421 (diff) |
* (bug 5092) Improve ckit repair targeting direction (/dev/humancontroller/)
Diffstat (limited to 'src/game/g_weapon.c')
-rw-r--r-- | src/game/g_weapon.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c index 1c227ffd..3bf257bc 100644 --- a/src/game/g_weapon.c +++ b/src/game/g_weapon.c @@ -780,23 +780,22 @@ BUILD GUN */ void CheckCkitRepair( gentity_t *ent ) { - vec3_t forward, end; + vec3_t viewOrigin, forward, end; trace_t tr; gentity_t *traceEnt; int bHealth; if( ent->client->ps.weaponTime > 0 || ent->client->ps.stats[ STAT_MISC ] > 0 ) - return; + return; - // Construction kit repair + BG_GetClientViewOrigin( &ent->client->ps, viewOrigin ); AngleVectors( ent->client->ps.viewangles, forward, NULL, NULL ); - VectorMA( ent->client->ps.origin, 100, forward, end ); - - trap_Trace( &tr, ent->client->ps.origin, NULL, NULL, end, ent->s.number, - MASK_PLAYERSOLID ); + VectorMA( viewOrigin, 100, forward, end ); + + trap_Trace( &tr, viewOrigin, NULL, NULL, end, ent->s.number, MASK_PLAYERSOLID ); traceEnt = &g_entities[ tr.entityNum ]; - + if( tr.fraction < 1.0f && traceEnt->spawned && traceEnt->health > 0 && traceEnt->s.eType == ET_BUILDABLE && traceEnt->buildableTeam == TEAM_HUMANS ) { |