summaryrefslogtreecommitdiff
path: root/src/cgame
diff options
context:
space:
mode:
authorM. Kristall <mkpdev@gmail.com>2009-10-05 04:44:45 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:16:39 +0000
commitddb1d8ec4db9c2ac69b7313fbfb6d10347a4d3e8 (patch)
tree8b83aa68753bf2717ad30723e256ffb5baee464b /src/cgame
parent3c0790c7ec1bb2802ddd6d6cae713284b38bfd0a (diff)
* Fix ordinals in spawn queue to not display 21th, 22th, 23th etc.
* Try to be nice to log parsers
Diffstat (limited to 'src/cgame')
-rw-r--r--src/cgame/cg_draw.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c
index fe81e269..4ae6792d 100644
--- a/src/cgame/cg_draw.c
+++ b/src/cgame/cg_draw.c
@@ -2913,12 +2913,22 @@ static qboolean CG_DrawQueue( void )
if( position < 1 )
return qfalse;
- switch( position )
+ switch( position % 100 )
{
- case 1: ordinal = "st"; break;
- case 2: ordinal = "nd"; break;
- case 3: ordinal = "rd"; break;
- default: ordinal = "th"; break;
+ case 11:
+ case 12:
+ case 13:
+ ordinal = "th";
+ break;
+ default:
+ switch( position % 10 )
+ {
+ case 1: ordinal = "st"; break;
+ case 2: ordinal = "nd"; break;
+ case 3: ordinal = "rd"; break;
+ default: ordinal = "th"; break;
+ }
+ break;
}
Com_sprintf( buffer, MAX_STRING_CHARS, "You are %d%s in the spawn queue",