From ddb1d8ec4db9c2ac69b7313fbfb6d10347a4d3e8 Mon Sep 17 00:00:00 2001 From: "M. Kristall" Date: Mon, 5 Oct 2009 04:44:45 +0000 Subject: * Fix ordinals in spawn queue to not display 21th, 22th, 23th etc. * Try to be nice to log parsers --- src/cgame/cg_draw.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'src/cgame') 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", -- cgit