From 4e57c73605411b8ae309c8d7fde084fd3eeb2f68 Mon Sep 17 00:00:00 2001 From: Richard Allen Date: Sat, 2 Mar 2002 14:54:24 +0000 Subject: [PATCH] Added the skin and model names to the name of the player thats being followed, as in AQ --- reaction/cgame/cg_draw.c | 20 +++++++++++++++----- reaction/game/g_client.c | 19 +++++++++++++++++-- reaction/game/g_cmds.c | 6 +++++- 3 files changed, 37 insertions(+), 8 deletions(-) diff --git a/reaction/cgame/cg_draw.c b/reaction/cgame/cg_draw.c index 253a592c..69d3c38e 100644 --- a/reaction/cgame/cg_draw.c +++ b/reaction/cgame/cg_draw.c @@ -5,6 +5,10 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.23 2002/03/02 14:54:24 jbravo +// Added the skin and model names to the name of the player thats being +// followed, as in AQ +// // Revision 1.22 2002/02/28 05:41:54 blaze // weapons stats on client side // @@ -2474,6 +2478,8 @@ static qboolean CG_DrawFollow( void ) { float x; vec4_t color; const char *name; + int team; + char combinedName[512]; if ( !(cg.snap->ps.pm_flags & PMF_FOLLOW) ) { return qfalse; @@ -2483,20 +2489,24 @@ static qboolean CG_DrawFollow( void ) { color[2] = 1; color[3] = 1; + team = cgs.clientinfo[ cg.snap->ps.clientNum ].team; + + Com_sprintf (combinedName, sizeof(combinedName), "%s\\%s/%s", + cgs.clientinfo[ cg.snap->ps.clientNum ].name, + cgs.clientinfo[ cg.snap->ps.clientNum ].modelName, + cgs.clientinfo[ cg.snap->ps.clientNum ].skinName); + CG_DrawBigString( 320 - 9 * 8, 24, "following", 1.0F ); - name = cgs.clientinfo[ cg.snap->ps.clientNum ].name; + x = 0.5 * ( 640 - GIANT_WIDTH -16 * CG_DrawStrlen( combinedName ) ); - x = 0.5 * ( 640 - GIANT_WIDTH * CG_DrawStrlen( name ) ); - - CG_DrawStringExt( x, 40, name, color, qtrue, qtrue, GIANT_WIDTH, GIANT_HEIGHT, 0 ); + CG_DrawStringExt( x, 40, combinedName, color, qtrue, qtrue, GIANT_WIDTH - 16, GIANT_HEIGHT - 16, 0 ); return qtrue; } - /* ================= CG_DrawAmmoWarning diff --git a/reaction/game/g_client.c b/reaction/game/g_client.c index 776650ca..2d0787d9 100644 --- a/reaction/game/g_client.c +++ b/reaction/game/g_client.c @@ -5,6 +5,10 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.42 2002/03/02 14:54:24 jbravo +// Added the skin and model names to the name of the player thats being +// followed, as in AQ +// // Revision 1.41 2002/03/01 18:21:26 jbravo // Cleanups and removal of g_RQ3_sniperup // @@ -1156,7 +1160,7 @@ void ClientBegin( int clientNum ) { gentity_t *ent; gclient_t *client; int flags; - int savedPing,i; + int savedPing, i; int savedPers[MAX_PERSISTANT]; ent = g_entities + clientNum; @@ -1237,6 +1241,7 @@ void ClientBegin( int clientNum ) { // NiceAss: Only set it if there is no value. Fix for going into spectator resetting values. if (!client->teamplayWeapon) client->teamplayWeapon = WP_MP5; if (!client->teamplayItem) client->teamplayItem = HI_KEVLAR; + i = RQ3TeamCount( -1, client->sess.sessionTeam); } } @@ -1571,7 +1576,7 @@ server system housekeeping. void ClientDisconnect( int clientNum ) { gentity_t *ent; gentity_t *tent; - int i; + int oldTeam, i; // cleanup if we are kicking a bot that // hasn't spawned yet @@ -1582,6 +1587,11 @@ void ClientDisconnect( int clientNum ) { return; } +// JBravo: to keep the ui teamcount cvars right. + if (g_gametype.integer == GT_TEAMPLAY) { + oldTeam = ent->client->sess.sessionTeam; + } + //Slicer: matchmode if(g_RQ3_matchmode.integer) { switch(ent->client->pers.captain ) { @@ -1647,6 +1657,11 @@ void ClientDisconnect( int clientNum ) { CalculateRanks(); +// JBravo: to keep the ui teamcount cvars right. + if (g_gametype.integer == GT_TEAMPLAY) { + i = RQ3TeamCount( -1, oldTeam); + } + if ( ent->r.svFlags & SVF_BOT ) { BotAIShutdownClient( clientNum, qfalse ); } diff --git a/reaction/game/g_cmds.c b/reaction/game/g_cmds.c index 15c4067c..45174d56 100644 --- a/reaction/game/g_cmds.c +++ b/reaction/game/g_cmds.c @@ -5,6 +5,10 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.64 2002/03/02 14:54:24 jbravo +// Added the skin and model names to the name of the player thats being +// followed, as in AQ +// // Revision 1.63 2002/03/01 20:22:31 jbravo // Fixed a small booboo with the teamcounts // @@ -1087,7 +1091,7 @@ static void G_SayTo(gentity_t *ent, gentity_t *other, int mode, int color, const if (ent->client->sess.sessionTeam == TEAM_SPECTATOR && (other->client->sess.sessionTeam == TEAM_RED || other->client->sess.sessionTeam == TEAM_BLUE) && - g_gametype.integer == GT_TEAMPLAY) { + level.team_round_going && g_gametype.integer == GT_TEAMPLAY) { return; }