summaryrefslogtreecommitdiff
path: root/src/cgame
diff options
context:
space:
mode:
Diffstat (limited to 'src/cgame')
-rw-r--r--src/cgame/cg_draw.c41
-rw-r--r--src/cgame/cg_local.h5
-rw-r--r--src/cgame/cg_main.c3
-rw-r--r--src/cgame/cg_servercmds.c3
-rw-r--r--src/cgame/cg_tutorial.c11
-rw-r--r--src/cgame/cg_view.c3
6 files changed, 36 insertions, 30 deletions
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c
index bc012338..4720fd0f 100644
--- a/src/cgame/cg_draw.c
+++ b/src/cgame/cg_draw.c
@@ -2730,7 +2730,7 @@ static qboolean CG_DrawFollow( void )
vec4_t color;
char buffer[ MAX_STRING_CHARS ];
- if( !( cg.snap->ps.pm_flags & PMF_FOLLOW ) )
+ if( cg.snap->ps.clientNum == cg.clientNum )
return qfalse;
color[ 0 ] = 1;
@@ -2756,7 +2756,8 @@ static qboolean CG_DrawQueue( void )
{
float w;
vec4_t color;
- char buffer[ MAX_STRING_CHARS ];
+ int position, remainder;
+ char *ordinal, buffer[ MAX_STRING_CHARS ];
if( !( cg.snap->ps.pm_flags & PMF_QUEUED ) )
return qfalse;
@@ -2766,28 +2767,28 @@ static qboolean CG_DrawQueue( void )
color[ 2 ] = 1;
color[ 3 ] = 1;
- Com_sprintf( buffer, MAX_STRING_CHARS, "You are in position %d of the spawn queue.",
- cg.snap->ps.persistant[ PERS_QUEUEPOS ] + 1 );
+ 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";
+ Com_sprintf( buffer, MAX_STRING_CHARS, "You are %d%s in the spawn queue",
+ position, ordinal );
w = UI_Text_Width( buffer, 0.7f, 0 );
UI_Text_Paint( 320 - w / 2, 360, 0.7f, color, buffer, 0, 0, ITEM_TEXTSTYLE_SHADOWED );
- if( cg.snap->ps.stats[ STAT_PTEAM ] == PTE_ALIENS )
- {
- if( cgs.numAlienSpawns == 1 )
- Com_sprintf( buffer, MAX_STRING_CHARS, "There is 1 spawn remaining." );
- else
- Com_sprintf( buffer, MAX_STRING_CHARS, "There are %d spawns remaining.",
- cgs.numAlienSpawns );
- }
- else if( cg.snap->ps.stats[ STAT_PTEAM ] == PTE_HUMANS )
- {
- if( cgs.numHumanSpawns == 1 )
- Com_sprintf( buffer, MAX_STRING_CHARS, "There is 1 spawn remaining." );
- else
- Com_sprintf( buffer, MAX_STRING_CHARS, "There are %d spawns remaining.",
- cgs.numHumanSpawns );
- }
+ if( cg.snap->ps.persistant[ PERS_SPAWNS ] == 1 )
+ Com_sprintf( buffer, MAX_STRING_CHARS, "There is 1 spawn remaining" );
+ else
+ Com_sprintf( buffer, MAX_STRING_CHARS, "There are %d spawns remaining",
+ cg.snap->ps.persistant[ PERS_SPAWNS ] );
w = UI_Text_Width( buffer, 0.7f, 0 );
UI_Text_Paint( 320 - w / 2, 400, 0.7f, color, buffer, 0, 0, ITEM_TEXTSTYLE_SHADOWED );
diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h
index 71e4a14c..360dac34 100644
--- a/src/cgame/cg_local.h
+++ b/src/cgame/cg_local.h
@@ -1346,9 +1346,6 @@ typedef struct
int alienNextStageThreshold;
int humanNextStageThreshold;
- int numAlienSpawns;
- int numHumanSpawns;
-
//
// locally derived information from gamestate
//
@@ -1508,6 +1505,8 @@ extern vmCvar_t cg_painBlendMax;
extern vmCvar_t cg_painBlendScale;
extern vmCvar_t cg_painBlendZoom;
+extern vmCvar_t cg_stickySpec;
+
extern vmCvar_t ui_currentClass;
extern vmCvar_t ui_carriage;
extern vmCvar_t ui_stages;
diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c
index 0f68f488..8c472321 100644
--- a/src/cgame/cg_main.c
+++ b/src/cgame/cg_main.c
@@ -222,6 +222,8 @@ vmCvar_t cg_painBlendMax;
vmCvar_t cg_painBlendScale;
vmCvar_t cg_painBlendZoom;
+vmCvar_t cg_stickySpec;
+
vmCvar_t ui_currentClass;
vmCvar_t ui_carriage;
vmCvar_t ui_stages;
@@ -319,6 +321,7 @@ static cvarTable_t cvarTable[ ] =
{ &cg_wwSmoothTime, "cg_wwSmoothTime", "300", CVAR_ARCHIVE },
{ &cg_wwFollow, "cg_wwFollow", "1", CVAR_ARCHIVE|CVAR_USERINFO },
{ &cg_wwToggle, "cg_wwToggle", "1", CVAR_ARCHIVE|CVAR_USERINFO },
+ { &cg_stickySpec, "cg_stickySpec", "1", CVAR_ARCHIVE|CVAR_USERINFO },
{ &cg_depthSortParticles, "cg_depthSortParticles", "1", CVAR_ARCHIVE },
{ &cg_bounceParticles, "cg_bounceParticles", "0", CVAR_ARCHIVE },
{ &cg_consoleLatency, "cg_consoleLatency", "3000", CVAR_ARCHIVE },
diff --git a/src/cgame/cg_servercmds.c b/src/cgame/cg_servercmds.c
index afc45780..5c150e97 100644
--- a/src/cgame/cg_servercmds.c
+++ b/src/cgame/cg_servercmds.c
@@ -158,7 +158,6 @@ void CG_SetConfigValues( void )
sscanf( CG_ConfigString( CS_STAGES ), "%d %d %d %d %d %d", &cgs.alienStage, &cgs.humanStage,
&cgs.alienKills, &cgs.humanKills, &cgs.alienNextStageThreshold, &cgs.humanNextStageThreshold );
- sscanf( CG_ConfigString( CS_SPAWNS ), "%d %d", &cgs.numAlienSpawns, &cgs.numHumanSpawns );
cgs.levelStartTime = atoi( CG_ConfigString( CS_LEVEL_START_TIME ) );
cg.warmup = atoi( CG_ConfigString( CS_WARMUP ) );
@@ -292,8 +291,6 @@ static void CG_ConfigStringModified( void )
if( cgs.humanStage != oldHumanStage )
CG_AnnounceHumanStageTransistion( oldHumanStage, cgs.humanStage );
}
- else if( num == CS_SPAWNS )
- sscanf( str, "%d %d", &cgs.numAlienSpawns, &cgs.numHumanSpawns );
else if( num == CS_LEVEL_START_TIME )
cgs.levelStartTime = atoi( str );
else if( num == CS_VOTE_TIME )
diff --git a/src/cgame/cg_tutorial.c b/src/cgame/cg_tutorial.c
index b2abd7a5..04d0ec28 100644
--- a/src/cgame/cg_tutorial.c
+++ b/src/cgame/cg_tutorial.c
@@ -558,9 +558,14 @@ static void CG_SpectatorText( char *text, playerState_t *ps )
{
if( cgs.clientinfo[ cg.clientNum ].team != PTE_NONE )
{
- Q_strcat( text, MAX_TUTORIAL_TEXT,
- va( "Press %s to spawn\n",
- CG_KeyNameForCommand( "+attack" ) ) );
+ if( ps->pm_flags & PMF_QUEUED )
+ Q_strcat( text, MAX_TUTORIAL_TEXT,
+ va( "Press %s to leave spawn queue\n",
+ CG_KeyNameForCommand( "+attack" ) ) );
+ else
+ Q_strcat( text, MAX_TUTORIAL_TEXT,
+ va( "Press %s to spawn\n",
+ CG_KeyNameForCommand( "+attack" ) ) );
}
else
{
diff --git a/src/cgame/cg_view.c b/src/cgame/cg_view.c
index 16a16478..2c718556 100644
--- a/src/cgame/cg_view.c
+++ b/src/cgame/cg_view.c
@@ -1052,7 +1052,8 @@ static int CG_CalcViewValues( void )
ps = &cg.predictedPlayerState;
// intermission view
- if( ps->pm_type == PM_INTERMISSION )
+ if( ps->pm_type == PM_INTERMISSION || ps->pm_type == PM_FREEZE ||
+ ps->pm_type == PM_SPECTATOR )
{
VectorCopy( ps->origin, cg.refdef.vieworg );
VectorCopy( ps->viewangles, cg.refdefViewAngles );