mirror of
https://github.com/ReactionQuake3/reaction.git
synced 2025-01-22 09:31:11 +00:00
More Matchmode code and fixed 2 bugs in TP
This commit is contained in:
parent
fb84e2e787
commit
9d16185f5b
6 changed files with 51 additions and 22 deletions
|
@ -5,8 +5,8 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.29 2002/02/02 20:39:09 slicer
|
||||
// Matchmode: Adding Captains
|
||||
// Revision 1.30 2002/02/03 21:23:51 slicer
|
||||
// More Matchmode code and fixed 2 bugs in TP
|
||||
//
|
||||
// Revision 1.28 2002/02/01 01:00:36 slicer
|
||||
// Adding Matchmode: just a few basics and files...
|
||||
|
@ -1523,6 +1523,18 @@ void ClientDisconnect( int clientNum ) {
|
|||
return;
|
||||
}
|
||||
|
||||
//Slicer: matchmode
|
||||
if(g_gametype.integer) {
|
||||
switch(ent->client->pers.captain ) {
|
||||
case TEAM_RED:
|
||||
level.team1ready = qfalse;
|
||||
break;
|
||||
case TEAM_BLUE:
|
||||
level.team2ready = qfalse;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// stop any following clients
|
||||
for ( i = 0 ; i < level.maxclients ; i++ ) {
|
||||
if ( level.clients[i].sess.sessionTeam == TEAM_SPECTATOR
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.45 2002/02/02 21:53:56 slicer
|
||||
// Matchmode stuff
|
||||
// Revision 1.46 2002/02/03 21:23:51 slicer
|
||||
// More Matchmode code and fixed 2 bugs in TP
|
||||
//
|
||||
// Revision 1.43 2002/02/02 16:34:02 slicer
|
||||
// Matchmode..
|
||||
|
@ -708,11 +708,10 @@ void SetTeam( gentity_t *ent, char *s ) {
|
|||
}
|
||||
|
||||
|
||||
//Slicer : Matchmode
|
||||
//Slicer : Matchmode - If a captain changes team , that team is no longer ready
|
||||
if(g_matchmode.integer) {
|
||||
client->sess.savedTeam = team;
|
||||
|
||||
switch(team) {
|
||||
// client->sess.savedTeam = team;
|
||||
switch(ent->client->pers.captain) {
|
||||
case TEAM_RED:
|
||||
level.team1ready = qfalse;
|
||||
break;
|
||||
|
@ -720,7 +719,6 @@ void SetTeam( gentity_t *ent, char *s ) {
|
|||
level.team2ready = qfalse;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// they go to the end of the line for tournements
|
||||
|
|
|
@ -35,8 +35,12 @@ void MM_Sub_f( gentity_t *ent) {
|
|||
trap_SendServerCommand(ent-g_entities, "print \"You need to be on a team for that\n\"");
|
||||
return;
|
||||
}
|
||||
Com_Printf("%d \n",ent->client->pers.sub);
|
||||
if(ent->client->pers.sub == TEAM_FREE) {
|
||||
if (ent->client->ps.pm_type == PM_NORMAL) {
|
||||
ent->flags &= ~FL_GODMODE;
|
||||
ent->client->ps.stats[STAT_HEALTH] = ent->health = 0;
|
||||
player_die (ent, ent, ent, 100000, MOD_SUICIDE);
|
||||
}
|
||||
ent->client->pers.sub = ent->client->sess.savedTeam;
|
||||
trap_SendServerCommand( -1, va("print \"%s is now a Substitute for %s.\n\"",
|
||||
ent->client->pers.netname,
|
||||
|
@ -89,15 +93,17 @@ void MM_Ready_f(gentity_t *ent) {
|
|||
level.team1ready = qfalse;
|
||||
else
|
||||
level.team1ready = qtrue;
|
||||
trap_SendServerCommand( -1, va("print \"%s is %s Ready.\n\"",
|
||||
trap_SendServerCommand( -1, va("cp \"%s is %s Ready.\n\"",
|
||||
"Red Team",level.team1ready ? "": "no longer"));
|
||||
//trap_SendServerCommand( -1, va("print \"%s is %s Ready.\n\"",
|
||||
//"Red Team",level.team1ready ? "": "no longer"));
|
||||
}
|
||||
else {
|
||||
if(level.team2ready)
|
||||
level.team2ready = qfalse;
|
||||
else
|
||||
level.team2ready = qtrue;
|
||||
trap_SendServerCommand( -1, va("print \"%s is %s Ready.\n\"",
|
||||
trap_SendServerCommand( -1, va("cp \"%s is %s Ready.\n\"",
|
||||
"Red Team", level.team2ready ? "": "no longer"));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,3 +2,4 @@ void MM_RunFrame( void );
|
|||
void MM_Captain_f(gentity_t *ent );
|
||||
void MM_Sub_f( gentity_t *ent);
|
||||
void MM_Ready_f(gentity_t *ent);
|
||||
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.6 2002/02/02 20:39:09 slicer
|
||||
// Matchmode: Adding Captains
|
||||
// Revision 1.7 2002/02/03 21:23:51 slicer
|
||||
// More Matchmode code and fixed 2 bugs in TP
|
||||
//
|
||||
// Revision 1.5 2002/01/11 19:48:30 jbravo
|
||||
// Formatted the source in non DOS format.
|
||||
|
@ -106,7 +106,8 @@ void G_InitSessionData( gclient_t *client, char *userinfo ) {
|
|||
|
||||
sess = &client->sess;
|
||||
|
||||
//Slicer : setting savedteam
|
||||
//Slicer: init savedTeam also
|
||||
|
||||
sess->savedTeam = TEAM_SPECTATOR;
|
||||
|
||||
// initial team determination
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.8 2002/02/03 21:23:51 slicer
|
||||
// More Matchmode code and fixed 2 bugs in TP
|
||||
//
|
||||
// Revision 1.7 2002/01/29 03:13:45 jbravo
|
||||
// Further fixes to antistick
|
||||
//
|
||||
|
@ -197,7 +200,8 @@ void MakeAllLivePlayersObservers()
|
|||
|
||||
for (i = 0; i < level.maxclients; i++) {
|
||||
player = &g_entities[i];
|
||||
if (!player->inuse)
|
||||
//Slicer: Need to check if they are solid or not.
|
||||
if (!player->inuse || player->client->ps.pm_type != PM_NORMAL)
|
||||
continue;
|
||||
level.clients[i].sess.savedTeam = level.clients[i].sess.sessionTeam;
|
||||
level.clients[i].sess.sessionTeam = TEAM_SPECTATOR;
|
||||
|
@ -355,6 +359,9 @@ team_t RQ3TeamCount( int ignoreClientNum, int team )
|
|||
if ( level.clients[i].pers.connected == CON_DISCONNECTED ) {
|
||||
continue;
|
||||
}
|
||||
//Slicer: Matchmode - Subs don't count
|
||||
if(g_matchmode.integer && level.clients[i].pers.sub != TEAM_FREE)
|
||||
continue;
|
||||
if ( level.clients[i].sess.savedTeam == team ) {
|
||||
count++;
|
||||
}
|
||||
|
@ -398,6 +405,10 @@ void SpawnPlayers()
|
|||
|
||||
if (!player->inuse)
|
||||
continue;
|
||||
//Slicer: Matchmode - Subs don't spawn
|
||||
|
||||
if(g_matchmode.integer && player->client->pers.sub != TEAM_FREE)
|
||||
continue;
|
||||
|
||||
client = player->client;
|
||||
clientNum = client - level.clients;
|
||||
|
|
Loading…
Reference in a new issue