summaryrefslogtreecommitdiff
path: root/src/cgame
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2020-04-06 11:03:23 +0200
committerPaweł Redman <pawel.redman@gmail.com>2020-04-06 22:20:59 +0200
commitc77c95816fbbecba5994825d9b68b749ac7c0fe4 (patch)
treecc2a034dd2ea4dc9c75884c57a01c8a63ad14d8f /src/cgame
parentf675e7ad5e18e4fd67ddfc00702710b3f1b158e9 (diff)
Fractional evos - initial commit
I probably missed something; this needs proper testing.
Diffstat (limited to 'src/cgame')
-rw-r--r--src/cgame/cg_draw.c7
-rw-r--r--src/cgame/cg_main.c3
2 files changed, 6 insertions, 4 deletions
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c
index 33a275a..cea2527 100644
--- a/src/cgame/cg_draw.c
+++ b/src/cgame/cg_draw.c
@@ -539,10 +539,11 @@ static void CG_DrawPlayerCreditsValue( rectDef_t *rect, vec4_t color, qboolean p
value = ps->persistant[ PERS_CREDIT ];
if( value > -1 )
{
- if( cg.predictedPlayerState.stats[ STAT_PTEAM ] == PTE_ALIENS &&
- !CG_AtHighestClass( ) )
+ if( cg.predictedPlayerState.stats[ STAT_PTEAM ] == PTE_ALIENS )
{
- if( cg.time - cg.lastEvolveAttempt <= NO_CREDITS_TIME )
+ value = floor( value / EVO_TO_CREDS_RATE );
+
+ if( !CG_AtHighestClass( ) && cg.time - cg.lastEvolveAttempt <= NO_CREDITS_TIME )
{
if( ( ( cg.time - cg.lastEvolveAttempt ) / 300 ) % 2 )
color[ 3 ] = 0.0f;
diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c
index 89a4c5c..36a9577 100644
--- a/src/cgame/cg_main.c
+++ b/src/cgame/cg_main.c
@@ -489,6 +489,7 @@ static void CG_SetPVars( void )
trap_Cvar_Set( "player_stage", va( "%d", cgs.alienStage+1 ) );
trap_Cvar_Set( "player_bp", va( "%d", cgs.alienBuildPoints ));
trap_Cvar_Set( "player_maxbp", va( "%d", cgs.alienBuildPointsTotal ));
+ trap_Cvar_Set( "player_credits", va( "%f", ps->persistant[ PERS_CREDIT ] / EVO_TO_CREDS_RATE ) );
break;
case PTE_HUMANS:
@@ -498,10 +499,10 @@ static void CG_SetPVars( void )
trap_Cvar_Set( "player_kns", va( "%d",((cgs.humanStage==2)?0:abs(cgs.humanNextStageThreshold-cgs.humanKills))));
trap_Cvar_Set( "player_bp", va( "%d", cgs.humanBuildPoints ));
trap_Cvar_Set( "player_maxbp", va( "%d", cgs.humanBuildPointsTotal ));
+ trap_Cvar_Set( "player_credits", va( "%d", ps->persistant[ PERS_CREDIT ] ) );
break;
}
- trap_Cvar_Set( "player_credits", va( "%d", ps->persistant[ PERS_CREDIT ] ) );
trap_Cvar_Set( "player_score", va( "%d", ps->persistant[ PERS_SCORE ] ) );
trap_Cvar_Set( "player_deaths", va( "%d", ps->persistant[ PERS_KILLED ] ) );