diff options
Diffstat (limited to 'src/cgame')
-rw-r--r-- | src/cgame/cg_draw.c | 32 | ||||
-rw-r--r-- | src/cgame/cg_local.h | 2 | ||||
-rw-r--r-- | src/cgame/cg_main.c | 4 |
3 files changed, 27 insertions, 11 deletions
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c index da5d9101..6cc78738 100644 --- a/src/cgame/cg_draw.c +++ b/src/cgame/cg_draw.c @@ -423,13 +423,22 @@ static void CG_DrawPlayerStaminaBolt( rectDef_t *rect, vec4_t backColor, float stamina = cg.snap->ps.stats[ STAT_STAMINA ]; vec4_t color; - if( stamina < 0 ) - Vector4Copy( backColor, color ); - else if( cg.predictedPlayerState.stats[ STAT_STATE ] & SS_SPEEDBOOST ) - Vector4Lerp( ( sin( cg.time / 150.0f ) + 1 ) / 2, - backColor, foreColor, color ); + if( cg.predictedPlayerState.stats[ STAT_STATE ] & SS_SPEEDBOOST ) + { + if( stamina >= 0 ) + Vector4Lerp( ( sin( cg.time / 150.0f ) + 1 ) / 2, + backColor, foreColor, color ); + else + Vector4Lerp( ( sin( cg.time / 2000.0f ) + 1 ) / 2, + backColor, foreColor, color ); + } else - Vector4Copy( foreColor, color ); + { + if( stamina < 0 ) + Vector4Copy( backColor, color ); + else + Vector4Copy( foreColor, color ); + } trap_R_SetColor( color ); CG_DrawPic( rect->x, rect->y, rect->w, rect->h, shader ); @@ -2220,8 +2229,15 @@ static void CG_DrawSpeedText( rectDef_t *rect, float text_x, float text_y, VectorCopy( foreColor, color ); color[ 3 ] = 1; - - if( oldestSpeedSample == 0 ) + if( cg.predictedPlayerState.clientNum == cg.clientNum ) + { + vec3_t vel; + VectorCopy( cg.predictedPlayerState.velocity, vel ); + if( cg_drawSpeed.integer & SPEEDOMETER_IGNORE_Z ) + vel[ 2 ] = 0; + val = VectorLength( vel ); + } + else if( oldestSpeedSample == 0 ) val = speedSamples[ SPEEDOMETER_NUM_SAMPLES - 1 ]; else val = speedSamples[ oldestSpeedSample - 1 ]; diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h index 477bd384..6b146653 100644 --- a/src/cgame/cg_local.h +++ b/src/cgame/cg_local.h @@ -1517,7 +1517,7 @@ extern vmCvar_t cg_painBlendScale; extern vmCvar_t cg_painBlendZoom; extern vmCvar_t cg_stickySpec; -extern vmCvar_t cg_alwaysSprint; +extern vmCvar_t cg_sprintToggle; extern vmCvar_t cg_unlagged; extern vmCvar_t cg_debugVoices; diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c index feb16cae..61888f92 100644 --- a/src/cgame/cg_main.c +++ b/src/cgame/cg_main.c @@ -195,7 +195,7 @@ vmCvar_t cg_painBlendScale; vmCvar_t cg_painBlendZoom; vmCvar_t cg_stickySpec; -vmCvar_t cg_alwaysSprint; +vmCvar_t cg_sprintToggle; vmCvar_t cg_unlagged; vmCvar_t cg_debugVoices; @@ -287,7 +287,7 @@ static cvarTable_t cvarTable[ ] = { NULL, "cg_wwToggle", "1", CVAR_ARCHIVE|CVAR_USERINFO }, { NULL, "cg_disableBlueprintErrors", "0", CVAR_ARCHIVE|CVAR_USERINFO }, { &cg_stickySpec, "cg_stickySpec", "1", CVAR_ARCHIVE|CVAR_USERINFO }, - { &cg_alwaysSprint, "cg_alwaysSprint", "0", CVAR_ARCHIVE|CVAR_USERINFO }, + { &cg_sprintToggle, "cg_sprintToggle", "0", CVAR_ARCHIVE|CVAR_USERINFO }, { &cg_unlagged, "cg_unlagged", "1", CVAR_ARCHIVE|CVAR_USERINFO }, { NULL, "cg_flySpeed", "600", CVAR_ARCHIVE|CVAR_USERINFO }, { &cg_depthSortParticles, "cg_depthSortParticles", "1", CVAR_ARCHIVE }, |