From 614769430fe6bb31f7223cf05be1fabbd19ae32d Mon Sep 17 00:00:00 2001 From: Richard Allen Date: Wed, 24 Jul 2002 02:17:38 +0000 Subject: [PATCH] Added a respawn delay for CTB --- reaction/game/g_active.c | 12 +++++++++++- reaction/game/g_combat.c | 7 +++++++ reaction/game/g_local.h | 6 ++++++ reaction/game/g_main.c | 5 +++++ 4 files changed, 29 insertions(+), 1 deletion(-) diff --git a/reaction/game/g_active.c b/reaction/game/g_active.c index b6de73c8..d8299f17 100644 --- a/reaction/game/g_active.c +++ b/reaction/game/g_active.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.86 2002/07/24 02:17:38 jbravo +// Added a respawn delay for CTB +// // Revision 1.85 2002/07/22 06:33:04 niceass // cleaned up the powerup code // @@ -1182,13 +1185,20 @@ void ClientThink_real(gentity_t * ent) // forcerespawn is to prevent users from waiting out powerups if (g_forcerespawn.integer > 0 && (level.time - client->respawnTime) > g_forcerespawn.integer * 1000 && - g_gametype.integer != GT_TEAMPLAY) { + g_gametype.integer != GT_TEAMPLAY && g_gametype.integer != GT_CTF) { respawn(ent); return; } if (g_gametype.integer == GT_TEAMPLAY && level.time > client->respawnTime) { MakeSpectator(ent); } + if (g_gametype.integer == GT_CTF) { + if (level.time > client->time_of_death + (g_RQ3_ctb_respawndelay.integer * 1000)) { + respawn(ent); + } else { + return; + } + } // pressing attack or use is the normal respawn method // JBravo: make'em spactate if (ucmd->buttons & (BUTTON_ATTACK | BUTTON_USE_HOLDABLE)) { diff --git a/reaction/game/g_combat.c b/reaction/game/g_combat.c index 1489a46c..6d1948c2 100644 --- a/reaction/game/g_combat.c +++ b/reaction/game/g_combat.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.112 2002/07/24 02:17:38 jbravo +// Added a respawn delay for CTB +// // Revision 1.111 2002/07/20 18:26:25 jbravo // FF 2 fix for CTB // @@ -1468,6 +1471,10 @@ void player_die(gentity_t * self, gentity_t * inflictor, gentity_t * attacker, i } else { self->client->respawnTime = level.time + 1700; } + // JBravo: set the time of death for CTB + if (g_gametype.integer == GT_CTF) { + self->client->time_of_death = level.time; + } // remove powerups memset(self->client->ps.powerups, 0, sizeof(self->client->ps.powerups)); diff --git a/reaction/game/g_local.h b/reaction/game/g_local.h index bce99733..d2fb6838 100644 --- a/reaction/game/g_local.h +++ b/reaction/game/g_local.h @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.111 2002/07/24 02:17:38 jbravo +// Added a respawn delay for CTB +// // Revision 1.110 2002/07/16 04:07:53 niceass // temporary hack solution for map rotation and ctb // @@ -678,6 +681,8 @@ struct gclient_s { int rd_lastRadio; //Code of the last radio used int rd_repCount; //Counter for the number of repeated radio msgs float rd_repTime; //The time for the last repeated radio msg +// JBravo: time of death for delayed CTB respawns + int time_of_death; }; // JBravo: for model loading @@ -1294,6 +1299,7 @@ extern vmCvar_t g_RQ3_twbanrounds; // JBravo: no. of games team wounders are ban extern vmCvar_t g_RQ3_tkbanrounds; // JBravo: no. of games team killers are banned extern vmCvar_t g_RQ3_ppl_idletime; // JBravo: Seconds Idle before playing an insane sound extern vmCvar_t g_RQ3_idleaction; // JBravo: what to do with Idlers. 0 = sound, 1 = team none, 2 = kick +extern vmCvar_t g_RQ3_ctb_respawndelay; // JBravo: delay in seconds for ctb respawns //Slicer: Team Status Cvars for MM //extern vmCvar_t g_RQ3_team1ready; diff --git a/reaction/game/g_main.c b/reaction/game/g_main.c index 704fd09a..97336a98 100644 --- a/reaction/game/g_main.c +++ b/reaction/game/g_main.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.103 2002/07/24 02:17:38 jbravo +// Added a respawn delay for CTB +// // Revision 1.102 2002/07/19 04:29:58 niceass // include CTF in showing scoreboard at end of map // @@ -381,6 +384,7 @@ vmCvar_t g_RQ3_twbanrounds; vmCvar_t g_RQ3_tkbanrounds; vmCvar_t g_RQ3_ppl_idletime; vmCvar_t g_RQ3_idleaction; +vmCvar_t g_RQ3_ctb_respawndelay; //Slicer: Team Status Cvars for MM //vmCvar_t g_RQ3_team1ready; @@ -533,6 +537,7 @@ 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}, {&g_RQ3_ppl_idletime, "g_RQ3_ppl_idletime", "0", CVAR_ARCHIVE, 0, qtrue}, + {&g_RQ3_ctb_respawndelay, "g_RQ3_ctb_respawndelay", "5", CVAR_ARCHIVE, 0, qtrue}, {&g_RQ3_idleaction, "g_RQ3_idleaction", "0", CVAR_ARCHIVE, 0, qtrue}, //Blaze: let cvar.cfg be set by the server admins {&g_RQ3_cvarfile, "g_RQ3_cvarfile", "cvar.cfg", CVAR_ARCHIVE, 0, qtrue},