diff --git a/reaction/cgame/cg_effects.c b/reaction/cgame/cg_effects.c index 047fae5f..eb6ee5fa 100644 --- a/reaction/cgame/cg_effects.c +++ b/reaction/cgame/cg_effects.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.38 2002/06/23 04:36:27 niceass +// change to foglaser +// // Revision 1.37 2002/06/21 21:06:56 niceass // laserfog stuff // @@ -1176,10 +1179,10 @@ static void CG_VisibleLaser( vec3_t start, vec3_t finish ) { } -void CG_DrawVisibleLaser( vec3_t origin, int clientNum) { +void CG_DrawVisibleLaser( vec3_t origin, int clientNum, vec3_t dir) { int num, sourceContentType, destContentType; centity_t *cent; - vec3_t destination, start, end; + vec3_t start, end; trace_t trace; if ( !cg_enableLaserFog.integer ) @@ -1189,18 +1192,20 @@ void CG_DrawVisibleLaser( vec3_t origin, int clientNum) { cent = &cg_entities[cg.snap->entities[num].number]; if (cent->currentState.eType == ET_LASER && cent->currentState.clientNum == clientNum ) { - VectorCopy(cent->lerpOrigin, destination); break; } } - VectorCopy(origin, start); - VectorCopy(destination, end); - // Failed to find a laser dot that the player owns. if (num == cg.snap->numEntities) return; + VectorCopy(origin, start); + + VectorMA(origin, 8192 * 16, dir, end); + trap_CM_BoxTrace(&trace, start, end, NULL, NULL, 0, MASK_SHOT); + VectorCopy(trace.endpos, end); + sourceContentType = trap_CM_PointContents(start, 0); destContentType = trap_CM_PointContents(end, 0); diff --git a/reaction/cgame/cg_local.h b/reaction/cgame/cg_local.h index d3a06188..d9303afb 100644 --- a/reaction/cgame/cg_local.h +++ b/reaction/cgame/cg_local.h @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.101 2002/06/23 04:36:02 niceass +// change to foglaser +// // Revision 1.100 2002/06/21 23:20:34 blaze // cg_rq3_overlaycrosshair when set to 1 will draw your non zoomed crosshair overtop of your ssg crosshair // @@ -1914,7 +1917,7 @@ localEntity_t *CG_SmokePuff(const vec3_t p, void CG_BubbleTrail(vec3_t start, vec3_t end, float spacing); void CG_SpawnEffect(vec3_t org); void CG_ScorePlum(int client, vec3_t org, int score); -void CG_DrawVisibleLaser( vec3_t origin, int clientNum); +void CG_DrawVisibleLaser( vec3_t origin, int clientNum, vec3_t dir); //Blaze: for explosions void CG_Particle_Bleed(qhandle_t pshader, vec3_t start, vec3_t dir, int fleshEntityNum, int duration); diff --git a/reaction/cgame/cg_weapons.c b/reaction/cgame/cg_weapons.c index 0eaac5fd..b254a1f7 100644 --- a/reaction/cgame/cg_weapons.c +++ b/reaction/cgame/cg_weapons.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.85 2002/06/23 04:34:54 niceass +// change to foglaser +// // Revision 1.84 2002/06/21 04:09:44 niceass // fog laser // @@ -1727,12 +1730,12 @@ void CG_AddPlayerWeapon(refEntity_t * parent, playerState_t * ps, centity_t * ce cent->ejectBrassTime = 0; } - if ( cent->currentState.number != cg.predictedPlayerState.clientNum ) { refEntity_t muzzle; memset(&muzzle, 0, sizeof(muzzle)); CG_PositionEntityOnTag(&muzzle, &gun, weapon->weaponModel, "tag_flash"); - CG_DrawVisibleLaser(muzzle.origin, cent->currentState.clientNum); + + CG_DrawVisibleLaser(muzzle.origin, cent->currentState.clientNum, muzzle.axis[0]); } //Elder: re-added to fix loss of muzzle flashes!