diff options
Diffstat (limited to 'src/cgame')
-rw-r--r-- | src/cgame/cg_draw.c | 18 | ||||
-rw-r--r-- | src/cgame/cg_servercmds.c | 4 |
2 files changed, 15 insertions, 7 deletions
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c index 6609d153..da5d9101 100644 --- a/src/cgame/cg_draw.c +++ b/src/cgame/cg_draw.c @@ -57,6 +57,10 @@ static void CG_AlignText( rectDef_t *rect, const char *text, float scale, case ALIGN_CENTER: tx = ( rect->w - w ) / 2.0f; break; + + case ALIGN_NONE: + tx = 0; + break; } switch( valign ) @@ -73,6 +77,10 @@ static void CG_AlignText( rectDef_t *rect, const char *text, float scale, case VALIGN_CENTER: ty = h + ( ( rect->h - h ) / 2.0f ); break; + + case VALIGN_NONE: + ty = 0; + break; } if( x ) @@ -2430,7 +2438,7 @@ static void CG_ScanForCrosshairEntity( void ) team = cgs.clientinfo[ trace.entityNum ].team; - if( cg.snap->ps.persistant[ PERS_SPECSTATE ] == SPECTATOR_NOT ) + if( cg.snap->ps.stats[ STAT_TEAM ] != TEAM_NONE ) { //only display team names of those on the same team as this player if( team != cg.snap->ps.stats[ STAT_TEAM ] ) @@ -2463,13 +2471,13 @@ static void CG_DrawLocation( rectDef_t *rect, float scale, int textalign, vec4_t else location = CG_ConfigString( CS_LOCATIONS ); + // need to skip horiz. align if it's too long, but valign must be run either way if( UI_Text_Width( location, scale, 0 ) < rect->w ) - { CG_AlignText( rect, location, scale, 0.0f, 0.0f, textalign, VALIGN_CENTER, &tx, &ty ); - UI_Text_Paint( tx, ty, scale, color, location, 0, 0, ITEM_TEXTSTYLE_NORMAL ); - } else - UI_Text_Paint_Limit( &maxX, tx, ty, scale, color, location, 0, 0 ); + CG_AlignText( rect, location, scale, 0.0f, 0.0f, ALIGN_NONE, VALIGN_CENTER, &tx, &ty ); + + UI_Text_Paint_Limit( &maxX, tx, ty, scale, color, location, 0, 0 ); trap_R_SetColor( NULL ); } diff --git a/src/cgame/cg_servercmds.c b/src/cgame/cg_servercmds.c index 9af97006..3e4ebaae 100644 --- a/src/cgame/cg_servercmds.c +++ b/src/cgame/cg_servercmds.c @@ -940,8 +940,8 @@ static void CG_Say( int clientNum, saymode_t mode, const char *text ) Com_sprintf( prefix, sizeof( prefix ), "[^%c%c" S_COLOR_WHITE "] " S_COLOR_WHITE, tcolor, toupper( *( BG_TeamName( ci->team ) ) ) ); - if( ci && ( mode == SAY_TEAM || mode == SAY_AREA ) - && cg.snap->ps.pm_type != PM_INTERMISSION ) + if( ci && ( mode == SAY_TEAM || mode == SAY_AREA ) && + cg.snap->ps.pm_type != PM_INTERMISSION ) { if( clientNum == cg.snap->ps.clientNum ) { |