Skip to content

Commit

Permalink
scoreboard for instagib show rail acc instead of damage Irbyz#73
Browse files Browse the repository at this point in the history
  • Loading branch information
dedavidd committed Dec 14, 2018
1 parent 20cf66c commit d5630a8
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 7 deletions.
1 change: 1 addition & 0 deletions code/cgame/cg_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -1477,6 +1477,7 @@ typedef struct {
int csStatus;
int hitBeep[ WP_NUM_WEAPONS ];
int overtime;
int instagib;
} cgs_t;

//==============================================================================
Expand Down
19 changes: 12 additions & 7 deletions code/cgame/cg_scoreboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,18 @@ static void CG_DrawClientScore( int x, int y, int w, int h, score_t *score, floa
CG_DrawStringExt( x + w*0.5, y - SB_MEDCHAR_HEIGHT/2, va( "%i / %i / %i", score->captures, score->assistCount, score->defendCount ), colorWhite, qtrue, qfalse, SB_CHAR_WIDTH, SB_CHAR_HEIGHT, 0 );
}

if( h >= SB_CHAR_HEIGHT*2 ){
CG_DrawStringExt( x + w*0.66, y - SB_CHAR_HEIGHT, CG_FormatDmg(score->dmgdone), colorGreen, qtrue, qfalse, SB_CHAR_WIDTH, SB_CHAR_HEIGHT, 0 );
CG_DrawStringExt( x + w*0.66, y, CG_FormatDmg(score->dmgtaken), colorRed, qtrue, qfalse, SB_CHAR_WIDTH, SB_CHAR_HEIGHT, 0 );
}else{
strcpy( string, va( "^2%s^7/^1%s", CG_FormatDmg(score->dmgdone), CG_FormatDmg(score->dmgtaken) ) );
CG_DrawStringExt( x + w*0.66, y - SB_CHAR_HEIGHT/2, string, colorWhite, qfalse, qfalse, SB_CHAR_WIDTH, SB_CHAR_HEIGHT, 0 );
}
if (cgs.instagib == 1) {
strcpy( string, va( "%i%% Acc", ( ( int )( 100*( float )score->accuracys[ WP_RAILGUN ][ 1 ]/( float )score->accuracys[ WP_RAILGUN ][ 0 ] ) ) ) );
CG_DrawStringExt( x + w*0.66, y - SB_CHAR_HEIGHT/2, string, colorWhite, qfalse, qfalse, SB_CHAR_WIDTH, SB_CHAR_HEIGHT, 0 );
} else {
if( h >= SB_CHAR_HEIGHT*2 ){
CG_DrawStringExt( x + w*0.66, y - SB_CHAR_HEIGHT, CG_FormatDmg(score->dmgdone), colorGreen, qtrue, qfalse, SB_CHAR_WIDTH, SB_CHAR_HEIGHT, 0 );
CG_DrawStringExt( x + w*0.66, y, CG_FormatDmg(score->dmgtaken), colorRed, qtrue, qfalse, SB_CHAR_WIDTH, SB_CHAR_HEIGHT, 0 );
}else{
strcpy( string, va( "^2%s^7/^1%s", CG_FormatDmg(score->dmgdone), CG_FormatDmg(score->dmgtaken) ) );
CG_DrawStringExt( x + w*0.66, y - SB_CHAR_HEIGHT/2, string, colorWhite, qfalse, qfalse, SB_CHAR_WIDTH, SB_CHAR_HEIGHT, 0 );
}
}

if( h >= SB_CHAR_HEIGHT*2 ){
CG_DrawStringExt( x + w*0.74, y - SB_CHAR_HEIGHT, CG_FormatKD( score->frags ), colorGreen, qtrue, qfalse, SB_CHAR_WIDTH, SB_CHAR_HEIGHT, 0 );
Expand Down
1 change: 1 addition & 0 deletions code/cgame/cg_servercmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,7 @@ void CG_ParseServerinfo ( void ) {
cgs.maxclients = atoi ( Info_ValueForKey ( info, "sv_maxclients" ) );
cgs.roundtime = atoi ( Info_ValueForKey ( info, "elimination_roundtime" ) );
cgs.nopickup = atoi ( Info_ValueForKey ( info, "g_rockets" ) ) + atoi ( Info_ValueForKey ( info, "g_instantgib" ) ) + atoi ( Info_ValueForKey ( info, "g_elimination" ) );
cgs.instagib = atoi ( Info_ValueForKey ( info, "g_instantgib" ) ) ;
cgs.lms_mode = atoi ( Info_ValueForKey ( info, "g_lms_mode" ) );
cgs.altExcellent = atoi ( Info_ValueForKey ( info, "g_altExcellent" ) );
cgs.overtime = atoi ( Info_ValueForKey( info, "g_overtime" ) );
Expand Down
9 changes: 9 additions & 0 deletions code/game/g_svcmds_ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,22 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

#include "g_local.h"


// forward declare
void default_Svcmd_Status_f();

/*
============
Svcmd_status_f
Does Server Status from Console
============
*/
void Svcmd_Status_f( void )
{
default_Svcmd_Status_f();
}

void default_Svcmd_Status_f( void )
{
int i;
gclient_t *cl;
Expand Down

0 comments on commit d5630a8

Please sign in to comment.