More Matchmode code and fixed 2 bugs in TP

This commit is contained in:
Daniel Simoes 2002-02-03 21:23:51 +00:00
parent fb84e2e787
commit 9d16185f5b
6 changed files with 51 additions and 22 deletions

View file

@ -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

View file

@ -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,19 +708,17 @@ 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) {
case TEAM_RED:
level.team1ready = qfalse;
break;
case TEAM_BLUE:
level.team2ready = qfalse;
break;
// client->sess.savedTeam = team;
switch(ent->client->pers.captain) {
case TEAM_RED:
level.team1ready = qfalse;
break;
case TEAM_BLUE:
level.team2ready = qfalse;
break;
}
}
// they go to the end of the line for tournements

View file

@ -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"));
}
}

View file

@ -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);

View file

@ -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

View file

@ -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;