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_cmds.c | |
parent | 6e88c4903cce13a3e8399d5939811a6abadf4421 (diff) |
* (bug 5092) Improve ckit repair targeting direction (/dev/humancontroller/)
Diffstat (limited to 'src/game/g_cmds.c')
-rw-r--r-- | src/game/g_cmds.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index 6a67c1db..08824996 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -1856,7 +1856,7 @@ Cmd_Destroy_f */ void Cmd_Destroy_f( gentity_t *ent ) { - vec3_t forward, end; + vec3_t viewOrigin, forward, end; trace_t tr; gentity_t *traceEnt; char cmd[ 12 ]; @@ -1873,10 +1873,11 @@ void Cmd_Destroy_f( gentity_t *ent ) if( Q_stricmp( cmd, "destroy" ) == 0 ) deconstruct = qfalse; + BG_GetClientViewOrigin( &ent->client->ps, viewOrigin ); AngleVectors( ent->client->ps.viewangles, forward, NULL, NULL ); - VectorMA( ent->client->ps.origin, 100, forward, end ); + VectorMA( viewOrigin, 100, forward, end ); - trap_Trace( &tr, ent->client->ps.origin, NULL, NULL, end, ent->s.number, MASK_PLAYERSOLID ); + trap_Trace( &tr, viewOrigin, NULL, NULL, end, ent->s.number, MASK_PLAYERSOLID ); traceEnt = &g_entities[ tr.entityNum ]; if( tr.fraction < 1.0f && |