summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cgame/cg_local.h1
-rw-r--r--src/cgame/cg_main.c1
-rw-r--r--src/cgame/cg_players.c51
-rw-r--r--src/cgame/cg_weapons.c18
-rw-r--r--src/game/g_cmds.c2
-rw-r--r--src/game/tremulous.h2
-rw-r--r--src/ui/ui_main.c6
7 files changed, 44 insertions, 37 deletions
diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h
index 0ddf6574..3f95b9f5 100644
--- a/src/cgame/cg_local.h
+++ b/src/cgame/cg_local.h
@@ -942,6 +942,7 @@ typedef struct
qhandle_t larmourTorsoSkin;
qhandle_t jetpackModel;
+ qhandle_t jetpackFlashModel;
} cgMedia_t;
diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c
index f41de737..28d7120e 100644
--- a/src/cgame/cg_main.c
+++ b/src/cgame/cg_main.c
@@ -887,6 +887,7 @@ static void CG_RegisterClients( void )
cgs.media.larmourTorsoSkin = trap_R_RegisterSkin( "models/players/sarge/upper_red.skin" );
cgs.media.jetpackModel = trap_R_RegisterModel( "models/players/human_base/jetpack.md3" );
+ cgs.media.jetpackFlashModel = trap_R_RegisterModel( "models/players/human_base/jetpack_flash.md3" );
cg.charModelFraction = 1.0f;
trap_UpdateScreen( );
diff --git a/src/cgame/cg_players.c b/src/cgame/cg_players.c
index 4bfd4969..276b384a 100644
--- a/src/cgame/cg_players.c
+++ b/src/cgame/cg_players.c
@@ -1501,19 +1501,19 @@ static void CG_PlayerNonSegAngles( centity_t *cent, vec3_t srcAngles, vec3_t non
CG_PlayerUpgrade
===============
*/
-static void CG_PlayerUpgrades( centity_t *cent, refEntity_t *legs,
- vec3_t torsoAxis[ 3 ], qhandle_t legsModel )
+static void CG_PlayerUpgrades( centity_t *cent, refEntity_t *torso )
{
int held, active;
vec3_t acc = { 0.0f, 0.0f, 10.0f };
vec3_t vel = { 0.0f, 0.0f, 0.0f };
vec3_t origin;
- vec3_t back;
vec3_t forward = { 1.0f, 0.0f, 0.0f };
vec3_t right = { 0.0f, 1.0f, 0.0f };
vec3_t pvel;
+ vec3_t angles;
int addTime;
refEntity_t jetpack;
+ refEntity_t flash;
held = cent->currentState.modelindex;
active = cent->currentState.modelindex2;
@@ -1521,17 +1521,17 @@ static void CG_PlayerUpgrades( centity_t *cent, refEntity_t *legs,
if( held & ( 1 << UP_JETPACK ) )
{
memset( &jetpack, 0, sizeof( jetpack ) );
+ VectorCopy( torso->lightingOrigin, jetpack.lightingOrigin );
+ jetpack.shadowPlane = torso->shadowPlane;
+ jetpack.renderfx = torso->renderfx;
jetpack.hModel = cgs.media.jetpackModel;
- AxisCopy( torsoAxis, jetpack.axis );
- VectorCopy( cent->lerpOrigin, jetpack.lightingOrigin );
+ //identity matrix
+ AxisCopy( axisDefault, jetpack.axis );
//FIXME: change to tag_back when it exists
- CG_PositionRotatedEntityOnTag( &jetpack, legs, legsModel, "tag_torso" );
-
- jetpack.shadowPlane = legs->shadowPlane;
- jetpack.renderfx = legs->renderfx;
+ CG_PositionRotatedEntityOnTag( &jetpack, torso, torso->hModel, "tag_head" );
trap_R_AddRefEntityToScene( &jetpack );
@@ -1559,16 +1559,26 @@ static void CG_PlayerUpgrades( centity_t *cent, refEntity_t *legs,
vel[ 2 ] = -50.0f;
}
+ memset( &flash, 0, sizeof( flash ) );
+ VectorCopy( torso->lightingOrigin, flash.lightingOrigin );
+ flash.shadowPlane = torso->shadowPlane;
+ flash.renderfx = torso->renderfx;
+
+ flash.hModel = cgs.media.jetpackFlashModel;
+ if( !flash.hModel )
+ return;
+
+ angles[ YAW ] = 0;
+ angles[ PITCH ] = 0;
+ angles[ ROLL ] = 0;
+ AnglesToAxis( angles, flash.axis );
+
+ CG_PositionRotatedEntityOnTag( &flash, &jetpack, jetpack.hModel, "tag_flash" );
+ trap_R_AddRefEntityToScene( &flash );
+
if( cent->jetTime < cg.time )
{
- VectorCopy( cent->lerpOrigin, origin );
- AngleVectors( cent->lerpAngles, back, NULL, NULL );
- VectorInverse( back );
- back[ 2 ] = 0.0f;
- VectorNormalize( back );
-
- VectorMA( origin, 10.0f, back, origin );
- origin[ 2 ] += 10.0f;
+ VectorCopy( flash.origin, origin );
VectorScale( cent->currentState.pos.trDelta, 0.75f, pvel );
VectorAdd( vel, pvel, vel );
@@ -1940,7 +1950,7 @@ void CG_Player( centity_t *cent )
entityState_t *es = &cent->currentState;
int class = ( es->powerups >> 8 ) & 0xFF;
float scale;
- vec3_t tempAxis[ 3 ], tempAxis2[ 3 ], torsoAxis[ 3 ];
+ vec3_t tempAxis[ 3 ], tempAxis2[ 3 ];
vec3_t angles;
int held = es->modelindex;
pTeam_t team = es->powerups & 0xFF;
@@ -1993,9 +2003,6 @@ void CG_Player( centity_t *cent )
else
CG_PlayerNonSegAngles( cent, angles, legs.axis );
- //for CG_PlayerUpgrades
- AxisCopy( torso.axis, torsoAxis );
-
//rotate the legs axis to back to the wall
if( es->eFlags & EF_WALLCLIMB &&
BG_rotateAxis( es->angles2, legs.axis, tempAxis, qfalse, es->eFlags & EF_WALLCLIMBCEILING ) )
@@ -2146,7 +2153,7 @@ void CG_Player( centity_t *cent )
if( team == PTE_HUMANS )
CG_AddPlayerWeapon( &torso, NULL, cent );
- CG_PlayerUpgrades( cent, &legs, torsoAxis, ci->legsModel );
+ CG_PlayerUpgrades( cent, &torso );
}
/*
diff --git a/src/cgame/cg_weapons.c b/src/cgame/cg_weapons.c
index e5b5fc9d..a8e173b4 100644
--- a/src/cgame/cg_weapons.c
+++ b/src/cgame/cg_weapons.c
@@ -789,7 +789,7 @@ static void CG_PoisonCloud( centity_t *cent, int firstPoisonTime )
CG_FlameTrail
===============
*/
-static void CG_FlameTrail( centity_t *cent )
+static void CG_FlameTrail( centity_t *cent, vec3_t origin )
{
vec3_t forward, right, up;
vec3_t muzzlePoint;
@@ -803,29 +803,21 @@ static void CG_FlameTrail( centity_t *cent )
if( cg.time < cent->flamerTime )
return;
+ VectorCopy( origin, muzzlePoint );
+
if( cent->currentState.clientNum == cg.predictedPlayerState.clientNum && !cg.renderingThirdPerson )
{
AngleVectors( cg.refdefViewAngles, forward, right, up );
- VectorCopy( cg.refdef.vieworg, muzzlePoint );
VectorScale( cg.predictedPlayerState.velocity, FLAMER_LAG, pVelocity );
}
else
{
AngleVectors( cent->lerpAngles, forward, right, up );
- VectorCopy( cent->lerpOrigin, muzzlePoint );
-
- //FIXME: this is gonna look weird when crouching
- muzzlePoint[ 2 ] += DEFAULT_VIEWHEIGHT;
VectorScale( cent->currentState.pos.trDelta, FLAMER_LAG, pVelocity );
}
VectorMA( pVelocity, FLAMER_SPEED, forward, velocity );
- //FIXME: tweak these numbers when (if?) the flamer model is done
- VectorMA( muzzlePoint, 24.0f, forward, muzzlePoint );
- VectorMA( muzzlePoint, 6.0f, right, muzzlePoint );
- VectorMA( muzzlePoint, -6.0f, up, muzzlePoint );
-
CG_LaunchSprite( muzzlePoint, velocity, vec3_origin, 0.0f,
0.1f, 4.0f, 40.0f, 255.0f, 255.0f,
rand( ) % 360, cg.time, cg.time, FLAMER_LIFETIME,
@@ -1030,7 +1022,7 @@ void CG_AddPlayerWeapon( refEntity_t *parent, playerState_t *ps, centity_t *cent
// add lightning bolt
CG_LightningBolt( nonPredictedCent, flash.origin );
- CG_FlameTrail( nonPredictedCent );
+ CG_FlameTrail( nonPredictedCent, flash.origin );
// make a dlight for the flash
if( weapon->flashDlightColor[ 0 ] || weapon->flashDlightColor[ 1 ] || weapon->flashDlightColor[ 2 ] )
@@ -1089,7 +1081,7 @@ void CG_AddViewWeapon( playerState_t *ps )
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 ] );
+ CG_FlameTrail( &cg_entities[ ps->clientNum ], cg.refdef.vieworg );
}
return;
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c
index 888743f2..cca0e673 100644
--- a/src/game/g_cmds.c
+++ b/src/game/g_cmds.c
@@ -364,7 +364,7 @@ void Cmd_Team_f( gentity_t *ent )
if( oldTeam != ent->client->pers.pteam )
{
level.bankCredits[ ent->client->ps.clientNum ] = 0;
- ent->client->ps.persistant[ PERS_BANK ] = 0;
+ ent->client->ps.persistant[ PERS_CREDIT ] = 0;
ent->client->pers.pclass = 0;
ClientSpawn( ent, NULL );
}
diff --git a/src/game/tremulous.h b/src/game/tremulous.h
index fd7c013e..ed7fef4f 100644
--- a/src/game/tremulous.h
+++ b/src/game/tremulous.h
@@ -296,7 +296,7 @@
#define FLAMER_RADIUS 50
#define FLAMER_LIFETIME 1000.0f
#define FLAMER_SPEED 200.0f
-#define FLAMER_LAG 0.5f //the amount of player velocity that is added to the fireball
+#define FLAMER_LAG 0.65f //the amount of player velocity that is added to the fireball
#define MDRIVER_CLIPSIZE 5
#define MDRIVER_SPAWNCLIPS 2
diff --git a/src/ui/ui_main.c b/src/ui/ui_main.c
index 8f20effd..b01f62bc 100644
--- a/src/ui/ui_main.c
+++ b/src/ui/ui_main.c
@@ -4119,7 +4119,13 @@ static void UI_RunMenuScript(char **args) {
trap_Cmd_ExecuteText( EXEC_APPEND, cmd );
}
else if( Q_stricmp( name, "LoadAlienUpgrades" ) == 0 )
+ {
UI_LoadTremAlienUpgrades( );
+
+ //disallow the menu if it would be empty
+ if( uiInfo.tremAlienUpgradeCount <= 0 )
+ Menus_CloseAll( );
+ }
else if( Q_stricmp( name, "UpgradeToNewClass" ) == 0 )
{
if( cmd = uiInfo.tremAlienUpgradeList[ uiInfo.tremAlienUpgradeIndex ].cmd )