summaryrefslogtreecommitdiff
path: root/src/cgame
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2009-10-03 12:47:02 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:16:14 +0000
commitd8156afbb123a3493e2205b5f5b95ad8b98b172b (patch)
tree3b8718a48ee42cd9e3245ff23cae0153d47a61cb /src/cgame
parentd16cf28f22a4220bfa67216c1687d80ccbd780b4 (diff)
* Fix ordinals in spawn queue to not display 11st, 12nd, 13rd etc.
Diffstat (limited to 'src/cgame')
-rw-r--r--src/cgame/cg_draw.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c
index 3423957a..4c18e4c4 100644
--- a/src/cgame/cg_draw.c
+++ b/src/cgame/cg_draw.c
@@ -2861,7 +2861,7 @@ static qboolean CG_DrawQueue( void )
{
float w;
vec4_t color;
- int position, remainder;
+ int position;
char *ordinal, buffer[ MAX_STRING_CHARS ];
if( !( cg.snap->ps.pm_flags & PMF_QUEUED ) )
@@ -2875,14 +2875,15 @@ static qboolean CG_DrawQueue( void )
position = cg.snap->ps.persistant[ PERS_QUEUEPOS ] + 1;
if( position < 1 )
return qfalse;
- remainder = position % 10;
- ordinal = "th";
- if( remainder == 1 )
- ordinal = "st";
- else if( remainder == 2 )
- ordinal = "nd";
- else if( remainder == 3 )
- ordinal = "rd";
+
+ switch( position )
+ {
+ case 1: ordinal = "st"; break;
+ case 2: ordinal = "nd"; break;
+ case 3: ordinal = "rd"; break;
+ default: ordinal = "th"; break;
+ }
+
Com_sprintf( buffer, MAX_STRING_CHARS, "You are %d%s in the spawn queue",
position, ordinal );