commit b5efbefe95675dff802124f1ec89aaf479f1e516 Author: devhc Date: Mon Jul 18 21:27:20 2011 +0200 use construction kits instead of construction dicks diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index ad97ed7..2b44191 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -1840,7 +1840,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 ]; @@ -1857,10 +1857,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 && diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c index 1c227ff..3bf257b 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 ) {