summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorM. Kristall <mkpdev@gmail.com>2009-10-22 23:38:57 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:17:01 +0000
commit07931a1768dccad3a57fbd931f2189d0a4ef6408 (patch)
tree17bfff805ad9716cb57ba79bb7998c45fc45e499
parentbcf846aa6083f249519837aec8b9bd1732574ec5 (diff)
* Remove unnecessary counter argument to tinfo and scores since the number of
arguments is already known
-rw-r--r--src/cgame/cg_servercmds.c30
-rw-r--r--src/game/g_cmds.c2
-rw-r--r--src/game/g_team.c2
3 files changed, 17 insertions, 17 deletions
diff --git a/src/cgame/cg_servercmds.c b/src/cgame/cg_servercmds.c
index 3e4ebaae..67fa2bf1 100644
--- a/src/cgame/cg_servercmds.c
+++ b/src/cgame/cg_servercmds.c
@@ -38,13 +38,13 @@ static void CG_ParseScores( void )
{
int i;
- cg.numScores = atoi( CG_Argv( 1 ) );
+ cg.numScores = ( trap_Argc( ) - 3 ) / 6;
if( cg.numScores > MAX_CLIENTS )
cg.numScores = MAX_CLIENTS;
- cg.teamScores[ 0 ] = atoi( CG_Argv( 2 ) );
- cg.teamScores[ 1 ] = atoi( CG_Argv( 3 ) );
+ cg.teamScores[ 0 ] = atoi( CG_Argv( 1 ) );
+ cg.teamScores[ 1 ] = atoi( CG_Argv( 2 ) );
memset( cg.scores, 0, sizeof( cg.scores ) );
@@ -54,12 +54,12 @@ static void CG_ParseScores( void )
for( i = 0; i < cg.numScores; i++ )
{
//
- cg.scores[ i ].client = atoi( CG_Argv( i * 6 + 4 ) );
- cg.scores[ i ].score = atoi( CG_Argv( i * 6 + 5 ) );
- cg.scores[ i ].ping = atoi( CG_Argv( i * 6 + 6 ) );
- cg.scores[ i ].time = atoi( CG_Argv( i * 6 + 7 ) );
- cg.scores[ i ].weapon = atoi( CG_Argv( i * 6 + 8 ) );
- cg.scores[ i ].upgrade = atoi( CG_Argv( i * 6 + 9 ) );
+ cg.scores[ i ].client = atoi( CG_Argv( i * 6 + 3 ) );
+ cg.scores[ i ].score = atoi( CG_Argv( i * 6 + 4 ) );
+ cg.scores[ i ].ping = atoi( CG_Argv( i * 6 + 5 ) );
+ cg.scores[ i ].time = atoi( CG_Argv( i * 6 + 6 ) );
+ cg.scores[ i ].weapon = atoi( CG_Argv( i * 6 + 7 ) );
+ cg.scores[ i ].upgrade = atoi( CG_Argv( i * 6 + 8 ) );
if( cg.scores[ i ].client < 0 || cg.scores[ i ].client >= MAX_CLIENTS )
cg.scores[ i ].client = 0;
@@ -82,23 +82,23 @@ static void CG_ParseTeamInfo( void )
int count;
int client;
- count = atoi( CG_Argv( 1 ) );
+ count = ( trap_Argc( ) - 1 ) / 5;
cgs.teaminfoReceievedTime = cg.time;
for( i = 0; i < count; i++ )
{
- client = atoi( CG_Argv( i * 5 + 2 ) );
+ client = atoi( CG_Argv( i * 5 + 1 ) );
if( client < 0 || client >= MAX_CLIENTS )
{
CG_Error( "CG_ParseTeamInfo: bad client number: %d", client );
return;
}
- cgs.clientinfo[ client ].location = atoi( CG_Argv( i * 5 + 3 ) );
- cgs.clientinfo[ client ].health = atoi( CG_Argv( i * 5 + 4 ) );
- cgs.clientinfo[ client ].curWeaponClass = atoi( CG_Argv( i * 5 + 5 ) );
- cgs.clientinfo[ client ].upgrade = atoi( CG_Argv( i * 5 + 6 ) );
+ cgs.clientinfo[ client ].location = atoi( CG_Argv( i * 5 + 2 ) );
+ cgs.clientinfo[ client ].health = atoi( CG_Argv( i * 5 + 3 ) );
+ cgs.clientinfo[ client ].curWeaponClass = atoi( CG_Argv( i * 5 + 4 ) );
+ cgs.clientinfo[ client ].upgrade = atoi( CG_Argv( i * 5 + 5 ) );
}
}
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c
index e67fcced..09f1ed71 100644
--- a/src/game/g_cmds.c
+++ b/src/game/g_cmds.c
@@ -291,7 +291,7 @@ void ScoreboardMessage( gentity_t *ent )
stringlength += j;
}
- trap_SendServerCommand( ent-g_entities, va( "scores %i %i %i%s", i,
+ trap_SendServerCommand( ent-g_entities, va( "scores %i %i%s",
level.alienKills, level.humanKills, string ) );
}
diff --git a/src/game/g_team.c b/src/game/g_team.c
index 62805b3c..0c198611 100644
--- a/src/game/g_team.c
+++ b/src/game/g_team.c
@@ -384,7 +384,7 @@ void TeamplayInfoMessage( gentity_t *ent )
if( !sent )
return;
- trap_SendServerCommand( ent - g_entities, va( "tinfo %i%s", sent, string ) );
+ trap_SendServerCommand( ent - g_entities, va( "tinfo%s", string ) );
}
void CheckTeamStatus( void )