summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/cgame/cg_ents.c5
-rw-r--r--src/cgame/cg_weapons.c38
2 files changed, 41 insertions, 2 deletions
diff --git a/src/cgame/cg_ents.c b/src/cgame/cg_ents.c
index 560dbbf2..3b378fde 100644
--- a/src/cgame/cg_ents.c
+++ b/src/cgame/cg_ents.c
@@ -289,7 +289,7 @@ static void CG_Missile( centity_t *cent )
break;
case WP_FLAMER:
- {
+/* {
fraction = ( ( cg.time - s1->pos.trTime ) / FIREBALL_LIFETIME );
if( fraction > 1.0f )
@@ -303,7 +303,8 @@ static void CG_Missile( centity_t *cent )
ent.customShader = cgs.media.flameShader[ index ];
trap_R_AddRefEntityToScene( &ent );
return;
- }
+ }*/
+ return;
break;
default:
diff --git a/src/cgame/cg_weapons.c b/src/cgame/cg_weapons.c
index 089df54f..56232a7f 100644
--- a/src/cgame/cg_weapons.c
+++ b/src/cgame/cg_weapons.c
@@ -981,6 +981,40 @@ static void CG_LightningBolt( centity_t *cent, vec3_t origin ) {
/*
===============
+CG_FlameTrail
+===============
+*/
+static void CG_FlameTrail( centity_t *cent, vec3_t origin )
+{
+ vec3_t forward;
+ vec3_t muzzlePoint;
+
+ if( cent->currentState.weapon != WP_FLAMER )
+ return;
+
+ if( cent->currentState.clientNum == cg.predictedPlayerState.clientNum )
+ {
+ AngleVectors( cg.refdefViewAngles, forward, NULL, NULL );
+ VectorCopy( cg.predictedPlayerState.origin, muzzlePoint );
+ }
+ else
+ {
+ AngleVectors( cent->lerpAngles, forward, NULL, NULL );
+ VectorCopy( cent->lerpOrigin, muzzlePoint );
+ }
+
+ // FIXME: crouch
+ muzzlePoint[2] += DEFAULT_VIEWHEIGHT;
+
+ VectorMA( muzzlePoint, 8.0f, forward, muzzlePoint );
+ VectorScale( forward, 300.0f, forward );
+
+ CG_LaunchSprite( muzzlePoint, forward, vec3_origin, 0.1f, 0.0f, 48.0f, 192.0f, 64.0f, rand( ) % 360, cg.time, FIREBALL_LIFETIME, cgs.media.smokePuffShader, qfalse, qfalse );
+}
+
+
+/*
+===============
CG_SpawnRailTrail
Origin will be the exact tag point, which is slightly
@@ -1214,6 +1248,8 @@ void CG_AddPlayerWeapon( refEntity_t *parent, playerState_t *ps, centity_t *cent
cent->currentState.number != cg.predictedPlayerState.clientNum ) {
// add lightning bolt
CG_LightningBolt( nonPredictedCent, flash.origin );
+
+ CG_FlameTrail( nonPredictedCent, flash.origin );
// add rail trail
CG_SpawnRailTrail( cent, flash.origin );
@@ -1269,9 +1305,11 @@ void CG_AddViewWeapon( playerState_t *ps ) {
if ( cg.predictedPlayerState.eFlags & EF_FIRING ) {
// special hack for lightning gun...
+ // TA: and flamer
VectorCopy( cg.refdef.vieworg, origin );
VectorMA( origin, -8, cg.refdef.viewaxis[2], origin );
CG_LightningBolt( &cg_entities[ps->clientNum], origin );
+ CG_FlameTrail( &cg_entities[ps->clientNum], origin );
}
return;
}