From e2e57dfb6e3a7bc11540eb889a959a28e540d6df Mon Sep 17 00:00:00 2001 From: Daniel Simoes Date: Fri, 7 Jun 2002 19:07:08 +0000 Subject: [PATCH] removed cvars for teamXready, replaced by level.teamXready --- reaction/game/g_client.c | 7 +++++-- reaction/game/g_cmds.c | 9 ++++++--- reaction/game/g_local.h | 9 +++++++-- reaction/game/g_main.c | 15 +++++++++------ reaction/game/g_matchmode.c | 28 ++++++++++++++-------------- reaction/game/g_teamplay.c | 19 +++++++++++-------- 6 files changed, 52 insertions(+), 35 deletions(-) diff --git a/reaction/game/g_client.c b/reaction/game/g_client.c index 378a237f..fc653973 100644 --- a/reaction/game/g_client.c +++ b/reaction/game/g_client.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.86 2002/06/07 19:07:08 slicer +// removed cvars for teamXready, replaced by level.teamXready +// // Revision 1.85 2002/06/05 22:09:21 niceass // bot fix. NOT MY FAULT // @@ -1864,10 +1867,10 @@ void ClientDisconnect( int clientNum ) { if(g_RQ3_matchmode.integer) { switch(ent->client->sess.captain ) { case TEAM_RED: - trap_Cvar_Set("g_RQ3_team1ready", "0"); + level.team1ready = qfalse; break; case TEAM_BLUE: - trap_Cvar_Set("g_RQ3_team2ready", "0"); + level.team2ready = qfalse; break; default: break; diff --git a/reaction/game/g_cmds.c b/reaction/game/g_cmds.c index 4cfeb7db..79f940a7 100644 --- a/reaction/game/g_cmds.c +++ b/reaction/game/g_cmds.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.121 2002/06/07 19:07:08 slicer +// removed cvars for teamXready, replaced by level.teamXready +// // Revision 1.120 2002/06/05 23:53:05 jbravo // Color fixes for player names // @@ -340,7 +343,7 @@ void DeathmatchScoreboardMessage (gentity_t *ent) { trap_SendServerCommand(ent-g_entities, va("scores %i %i %i %i %i %i%s", i, level.teamScores[TEAM_RED], level.teamScores[TEAM_BLUE], - g_RQ3_team1ready.integer, g_RQ3_team2ready.integer, + level.team1ready, level.team2ready, (int)level.matchTime, string)); } @@ -970,10 +973,10 @@ void SetTeam (gentity_t *ent, char *s) { if (g_RQ3_matchmode.integer) { switch (ent->client->sess.captain) { case TEAM_RED: - trap_Cvar_Set ("g_RQ3_team1ready", "0"); + level.team1ready = qfalse; break; case TEAM_BLUE: - trap_Cvar_Set ("g_RQ3_team2ready", "0"); + level.team2ready = qfalse; break; default: break; diff --git a/reaction/game/g_local.h b/reaction/game/g_local.h index 9a2b97a6..af36960e 100644 --- a/reaction/game/g_local.h +++ b/reaction/game/g_local.h @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.89 2002/06/07 19:07:08 slicer +// removed cvars for teamXready, replaced by level.teamXready +// // Revision 1.88 2002/06/05 23:39:40 blaze // unbreakables work properly. Though I already commited this. // @@ -720,6 +723,8 @@ typedef struct { #endif // Slicer: Matchmode float matchTime; + qboolean team1ready; + qboolean team2ready; qboolean inGame; qboolean paused; // JBravo adding TP @@ -1214,8 +1219,8 @@ extern vmCvar_t g_RQ3_maxteamkills; // JBravo: Max teamkills extern vmCvar_t g_RQ3_twbanrounds; // JBravo: no. of games team wounders are banned extern vmCvar_t g_RQ3_tkbanrounds; // JBravo: no. of games team killers are banned //Slicer: Team Status Cvars for MM -extern vmCvar_t g_RQ3_team1ready; -extern vmCvar_t g_RQ3_team2ready; +//extern vmCvar_t g_RQ3_team1ready; +//extern vmCvar_t g_RQ3_team2ready; //aasimon: Ref System for MM extern vmCvar_t g_RQ3_AllowRef; extern vmCvar_t g_RQ3_RefPass; diff --git a/reaction/game/g_main.c b/reaction/game/g_main.c index 56784abe..6d4f47d8 100644 --- a/reaction/game/g_main.c +++ b/reaction/game/g_main.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.66 2002/06/07 19:07:08 slicer +// removed cvars for teamXready, replaced by level.teamXready +// // Revision 1.65 2002/06/07 13:06:34 jbravo // Disabled all gametypes except FFA and TP // @@ -267,8 +270,8 @@ vmCvar_t g_RQ3_maxteamkills; vmCvar_t g_RQ3_twbanrounds; vmCvar_t g_RQ3_tkbanrounds; //Slicer: Team Status Cvars for MM -vmCvar_t g_RQ3_team1ready; -vmCvar_t g_RQ3_team2ready; +//vmCvar_t g_RQ3_team1ready; +//vmCvar_t g_RQ3_team2ready; // aasimon: Ref System for MM vmCvar_t g_RQ3_AllowRef; vmCvar_t g_RQ3_RefPass; @@ -429,8 +432,8 @@ static cvarTable_t gameCvarTable[] = { { &g_RQ3_twbanrounds, "g_RQ3_twbanrounds", "2", CVAR_ARCHIVE, 0, qtrue}, { &g_RQ3_tkbanrounds, "g_RQ3_tkbanrounds", "2", CVAR_ARCHIVE, 0, qtrue}, //Slicer: Team Status Cvars for MM - { &g_RQ3_team1ready, "g_RQ3_team1ready", "0", 0, 0, qfalse}, - { &g_RQ3_team2ready, "g_RQ3_team2ready", "0", 0, 0, qfalse}, + //{ &g_RQ3_team1ready, "g_RQ3_team1ready", "0", 0, 0, qfalse}, + //{ &g_RQ3_team2ready, "g_RQ3_team2ready", "0", 0, 0, qfalse}, // aasimon: Ref system for MM,added infor for referee id (clientnumber) { &g_RQ3_AllowRef, "g_RQ3_AllowRef", "0", CVAR_SERVERINFO, 0, qtrue}, { &g_RQ3_RefPass, "g_RQ3_RefPassword", "", CVAR_USERINFO, 0, qfalse}, @@ -914,8 +917,8 @@ void G_InitGame( int levelTime, int randomSeed, int restart ) { if(g_RQ3_matchmode.integer && g_gametype.integer == GT_TEAMPLAY) { level.matchTime = 0; level.inGame = qfalse; - trap_Cvar_Set("g_RQ3_team1ready", "0"); - trap_Cvar_Set("g_RQ3_team2ready", "0"); + level.team1ready = qfalse; + level.team2ready = qfalse; refVotes[0] = refVotes[1] = -1; } diff --git a/reaction/game/g_matchmode.c b/reaction/game/g_matchmode.c index 84be99b2..0b6e38f1 100644 --- a/reaction/game/g_matchmode.c +++ b/reaction/game/g_matchmode.c @@ -79,12 +79,12 @@ void MM_Captain_f (gentity_t *ent) { return; } if (ent->client->sess.captain == TEAM_RED) { - trap_Cvar_Set("g_RQ3_team1ready", "0"); + level.team1ready = qfalse; trap_SendServerCommand( -1, va("print \"%s^7 is no longer %s's Captain.\n\"", ent->client->pers.netname, g_RQ3_team1name.string)); ent->client->sess.captain = TEAM_FREE; } else if (ent->client->sess.captain == TEAM_BLUE) { - trap_Cvar_Set("g_RQ3_team2ready", "0"); + level.team2ready = qfalse; trap_SendServerCommand( -1, va("print \"%s^7 is no longer %s's Captain.\n\"", ent->client->pers.netname, g_RQ3_team2name.string)); ent->client->sess.captain = TEAM_FREE; @@ -106,20 +106,20 @@ void MM_Ready_f (gentity_t *ent) { if (ent->client->sess.captain != TEAM_FREE) { if (ent->client->sess.savedTeam == TEAM_RED) { trap_SendServerCommand( -1, va("cp \"%s is%s Ready.\n\"", - g_RQ3_team1name.string, g_RQ3_team1ready.integer == 0 ? "": " no longer")); + g_RQ3_team1name.string, level.team1ready ? " no longer" : "")); - if (g_RQ3_team1ready.integer) - trap_Cvar_Set("g_RQ3_team1ready", "0"); + if (level.team1ready) + level.team1ready = qfalse; else - trap_Cvar_Set("g_RQ3_team1ready", "1"); + level.team1ready = qtrue; } else { trap_SendServerCommand( -1, va("cp \"%s is%s Ready.\n\"", - g_RQ3_team2name.string, g_RQ3_team2ready.integer == 0 ? "": " no longer")); + g_RQ3_team2name.string, level.team2ready ? " no longer" : "")); - if (g_RQ3_team2ready.integer) - trap_Cvar_Set("g_RQ3_team2ready", "0"); + if (level.team2ready) + level.team2ready = qfalse; else - trap_Cvar_Set("g_RQ3_team2ready", "1"); + level.team2ready = qtrue; } } else trap_SendServerCommand(ent-g_entities, "print \"You need to be a captain for that\n\""); @@ -156,14 +156,14 @@ void MM_TeamModel_f (gentity_t *ent) { trap_Argv(1, buff, sizeof(buff)); if (team == TEAM_RED) { - if (g_RQ3_team1ready.integer) { + if (level.team1ready) { trap_SendServerCommand(ent-g_entities, "print \"You need to un-ready your team for that..\n\""); return; } trap_Cvar_Set("g_RQ3_team1model", buff); trap_SendServerCommand(-1, va("print \"New Team 1 Model: %s\n\"", buff)); } else { - if (g_RQ3_team2ready.integer) { + if (level.team2ready) { trap_SendServerCommand(ent-g_entities, "print \"You need to un-ready your team for that..\n\""); return; } @@ -207,14 +207,14 @@ void MM_TeamName_f (gentity_t *ent) { buff[TEAM_NAME_SIZE] = 0; if (team == TEAM_RED) { - if (g_RQ3_team1ready.integer) { + if (level.team1ready) { trap_SendServerCommand(ent-g_entities, "print \"You need to un-ready your team for that..\n\""); return; } trap_Cvar_Set("g_RQ3_team1name", buff); trap_SendServerCommand(-1, va("print \"New Team 1 Name: %s\n\"", buff)); } else { - if (g_RQ3_team2ready.integer) { + if (level.team2ready) { trap_SendServerCommand(ent-g_entities, "print \"You need to un-ready your team for that..\n\""); return; } diff --git a/reaction/game/g_teamplay.c b/reaction/game/g_teamplay.c index ed05341b..cde02cf1 100644 --- a/reaction/game/g_teamplay.c +++ b/reaction/game/g_teamplay.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.103 2002/06/07 19:07:08 slicer +// removed cvars for teamXready, replaced by level.teamXready +// // Revision 1.102 2002/06/05 23:39:40 blaze // unbreakables work properly. Though I already commited this. // @@ -408,7 +411,7 @@ void CheckTeamRules() if (g_RQ3_matchmode.integer) { if(level.paused) trap_SendServerCommand( -1, "cp \"Referee has paused the Game!\n\""); - else if (g_RQ3_team1ready.integer && g_RQ3_team2ready.integer) + else if (level.team1ready && level.team2ready) trap_SendServerCommand( -1, "cp \"Not enough players to play!\n\""); else trap_SendServerCommand( -1, "cp \"Both Teams Must Be Ready!\n\""); @@ -447,8 +450,8 @@ void CheckTeamRules() level.inGame = level.team_round_going = level.team_round_countdown = level.team_game_going = level.matchTime = 0; trap_SendServerCommand( -1, va("rq3_cmd %i 0", ROUND)); - trap_Cvar_Set("g_RQ3_team1ready", "0"); - trap_Cvar_Set("g_RQ3_team2ready", "0"); + level.team1ready = qfalse; + level.team2ready = qfalse; MakeAllLivePlayersObservers (); trap_SendServerCommand( -1, "cp \"Match is OVER !!!.\n\""); return; @@ -538,7 +541,7 @@ qboolean BothTeamsHavePlayers() int onteam1 = 0, onteam2 = 0; //Slicer: Matchmode - if(g_RQ3_matchmode.integer && (!g_RQ3_team1ready.integer || !g_RQ3_team2ready.integer || level.paused)) + if(g_RQ3_matchmode.integer && (!level.team1ready || !level.team2ready || level.paused)) return 0; @@ -711,8 +714,8 @@ int WonGame(int winner) level.inGame = level.team_round_going = level.team_round_countdown = level.team_game_going = level.matchTime = 0; trap_SendServerCommand( -1, va("rq3_cmd %i 0", ROUND)); - trap_Cvar_Set("g_RQ3_team1ready", "0"); - trap_Cvar_Set("g_RQ3_team2ready", "0"); + level.team1ready = qfalse; + level.team2ready = qfalse; MakeAllLivePlayersObservers (); trap_SendServerCommand( -1, "cp \"Match is OVER !!!.\n\""); return 1; @@ -737,8 +740,8 @@ int WonGame(int winner) level.inGame = level.team_round_going = level.team_round_countdown = level.team_game_going = level.matchTime = 0; trap_SendServerCommand( -1, va("rq3_cmd %i 0", ROUND)); - trap_Cvar_Set("g_RQ3_team1ready", "0"); - trap_Cvar_Set("g_RQ3_team2ready", "0"); + level.team1ready = qfalse; + level.team2ready = qfalse; MakeAllLivePlayersObservers (); trap_SendServerCommand( -1, "cp \"Match is OVER !!!.\n\""); return 1;