From b54c0b3e7ba3346663f441772a1ae96e3cc7f466 Mon Sep 17 00:00:00 2001 From: Richard Allen Date: Fri, 26 Apr 2002 03:39:34 +0000 Subject: [PATCH] added tkok, fixed players always leaving zcam modes when player thats beeing tracked dies --- reaction/cgame/cg_consolecmds.c | 6 ++++++ reaction/cgame/cg_effects.c | 6 +++++- reaction/game/g_cmds.c | 7 +++++++ reaction/game/g_combat.c | 8 ++++++-- reaction/game/g_teamplay.c | 28 ++++++++++++++++++++++++++++ reaction/game/g_teamplay.h | 5 +++++ 6 files changed, 57 insertions(+), 3 deletions(-) diff --git a/reaction/cgame/cg_consolecmds.c b/reaction/cgame/cg_consolecmds.c index cc0a3e62..2d98d090 100644 --- a/reaction/cgame/cg_consolecmds.c +++ b/reaction/cgame/cg_consolecmds.c @@ -5,6 +5,10 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.44 2002/04/26 03:39:34 jbravo +// added tkok, fixed players always leaving zcam modes when player thats +// beeing tracked dies +// // Revision 1.43 2002/04/07 12:49:53 slicer // Added 'teamname' command for MM, and tweaked the cvar system. // @@ -974,6 +978,8 @@ void CG_InitConsoleCommands( void ) { trap_AddCommand ("radio"); trap_AddCommand ("radiogender"); trap_AddCommand ("radio_power"); +// JBravo: tkok + trap_AddCommand ("tkok"); // Slicer: Matchmode trap_AddCommand ("captain"); trap_AddCommand ("ready"); diff --git a/reaction/cgame/cg_effects.c b/reaction/cgame/cg_effects.c index 2ea91a2a..a9c3ee8d 100644 --- a/reaction/cgame/cg_effects.c +++ b/reaction/cgame/cg_effects.c @@ -5,6 +5,10 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.28 2002/04/26 03:39:34 jbravo +// added tkok, fixed players always leaving zcam modes when player thats +// beeing tracked dies +// // Revision 1.27 2002/04/23 06:10:10 niceass // some good tabbing // @@ -1336,4 +1340,4 @@ void CG_PressureWater( vec3_t origin, vec3_t dir ) VectorCopy(dir, le->pos.trDelta); le->startTime = cg.time; le->endTime = le->startTime + 10000; -} \ No newline at end of file +} diff --git a/reaction/game/g_cmds.c b/reaction/game/g_cmds.c index e9d761f9..dad7682f 100644 --- a/reaction/game/g_cmds.c +++ b/reaction/game/g_cmds.c @@ -5,6 +5,10 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.97 2002/04/26 03:39:34 jbravo +// added tkok, fixed players always leaving zcam modes when player thats +// beeing tracked dies +// // Revision 1.96 2002/04/23 06:03:05 niceass // scoreboard stuff // @@ -2883,6 +2887,9 @@ void ClientCommand( int clientNum ) { RQ3_Cmd_Radio_f (ent); else if (Q_stricmp (cmd, "dropweapon") == 0) // XRAY FMJ Cmd_DropWeapon_f( ent ); +// JBravo: adding tkok + else if (Q_stricmp (cmd, "tkok") == 0) + RQ3_Cmd_TKOk (ent); //Elder: stuff for dropping items else if (Q_stricmp (cmd, "dropitem") == 0) Cmd_DropItem_f( ent ); diff --git a/reaction/game/g_combat.c b/reaction/game/g_combat.c index 68803f65..3911b766 100644 --- a/reaction/game/g_combat.c +++ b/reaction/game/g_combat.c @@ -5,6 +5,10 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.63 2002/04/26 03:39:34 jbravo +// added tkok, fixed players always leaving zcam modes when player thats +// beeing tracked dies +// // Revision 1.62 2002/04/24 04:25:14 jbravo // No rewards (humiliation on dead player or Icon on attacker) for knife kills // @@ -1012,8 +1016,8 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int // JBravo: make clients that are following this one stop following. if (client->sess.spectatorClient == self->s.number) { if (g_gametype.integer == GT_TEAMPLAY) { -// StopFollowing(follower); - Cmd_FollowCycle_f(follower, 1); + if (client->sess.spectatorState != SPECTATOR_ZCAM) + Cmd_FollowCycle_f(follower, 1); } else { Cmd_Score_f(g_entities + i); } diff --git a/reaction/game/g_teamplay.c b/reaction/game/g_teamplay.c index fba7f975..f1fe9789 100644 --- a/reaction/game/g_teamplay.c +++ b/reaction/game/g_teamplay.c @@ -5,6 +5,10 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.65 2002/04/26 03:39:34 jbravo +// added tkok, fixed players always leaving zcam modes when player thats +// beeing tracked dies +// // Revision 1.64 2002/04/23 11:24:06 jbravo // Removed a debug message and did some cleanups // @@ -1677,3 +1681,27 @@ void setFFState(gentity_t *ent) ent->client->ff_warning = 0; } } + +void RQ3_Cmd_TKOk (gentity_t *ent) +{ + if (!ent->enemy || !ent->enemy->inuse || !ent->enemy->client || (ent == ent->enemy)) { + trap_SendServerCommand(ent-g_entities, va("print \"Nothing to forgive\n\"")); + } else if (ent->client->sess.savedTeam == ent->enemy->client->sess.sessionTeam) { + if (ent->enemy->client->team_kills) { + trap_SendServerCommand(ent-g_entities, va("print \"You forgave %s\n\"", + ent->enemy->client->pers.netname)); + trap_SendServerCommand(ent->enemy-g_entities, va("print \"%s forgave you\n", + ent->client->pers.netname)); + ent->enemy->client->team_kills--; + if (ent->enemy->client->team_wounds) + ent->enemy->client->team_wounds /= 2; + ent->enemy = NULL; + } + } else { + trap_SendServerCommand(ent-g_entities, va("print \"That's very noble of you...\n\"")); + trap_SendServerCommand( -1, va("print \"%s turned the other cheek\n\"", + ent->client->pers.netname)); + } + + ent->enemy = NULL; +} diff --git a/reaction/game/g_teamplay.h b/reaction/game/g_teamplay.h index c9e0552f..95c7c625 100644 --- a/reaction/game/g_teamplay.h +++ b/reaction/game/g_teamplay.h @@ -5,6 +5,10 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.12 2002/04/26 03:39:34 jbravo +// added tkok, fixed players always leaving zcam modes when player thats +// beeing tracked dies +// // Revision 1.11 2002/04/07 12:49:10 slicer // Added 'teamname' command for MM, and tweaked the cvar system. // @@ -75,5 +79,6 @@ void RQ3_Cmd_Radiogender_f (gentity_t *ent); void ParseSayText (gentity_t * ent, char *text); void RQ3_SpectatorMode(gentity_t *ent); void Add_TeamKill(gentity_t *attacker); +void RQ3_Cmd_TKOk(gentity_t *ent); void Add_TeamWound(gentity_t *attacker, gentity_t *victim, int mod); void setFFState(gentity_t *ent);