From 1aac35f129fd9457a79e2e70898f11d64d8d0844 Mon Sep 17 00:00:00 2001 From: Daniel Simoes Date: Thu, 13 Jun 2002 17:01:30 +0000 Subject: [PATCH] Radio Gender changes according to model gender --- reaction/game/g_cmds.c | 9 +++++++++ reaction/game/g_local.h | 6 ++++++ reaction/game/g_main.c | 26 ++++++++++++++++++++++++++ 3 files changed, 41 insertions(+) diff --git a/reaction/game/g_cmds.c b/reaction/game/g_cmds.c index 4ac7b37d..d8c62ca5 100644 --- a/reaction/game/g_cmds.c +++ b/reaction/game/g_cmds.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.128 2002/06/13 17:01:30 slicer +// Radio Gender changes according to model gender +// // Revision 1.127 2002/06/12 22:32:24 slicer // Even better way to improve the Cvar Anti-Cheat System // @@ -1048,6 +1051,12 @@ void SetTeam (gentity_t *ent, char *s) { client->sess.sessionTeam = client->sess.savedTeam; ClientUserinfoChanged (clientNum); client->sess.sessionTeam = teamsave; + //Slicer: Changing radio gender according to models + if(client->sess.savedTeam == TEAM_RED) + client->radioGender = level.team1gender; + else if(client->sess.savedTeam == TEAM_BLUE) + client->radioGender = level.team2gender; + } else { ClientUserinfoChanged (clientNum); ClientBegin (clientNum); diff --git a/reaction/game/g_local.h b/reaction/game/g_local.h index b911e112..5bb76b61 100644 --- a/reaction/game/g_local.h +++ b/reaction/game/g_local.h @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.92 2002/06/13 17:01:30 slicer +// Radio Gender changes according to model gender +// // Revision 1.91 2002/06/11 01:43:08 blaze // g_rq3_cvarfile allows you to change which file holds the restricted cvars // @@ -750,6 +753,9 @@ typedef struct { vec3_t team2spawn_angles; int fps; int lights_delay; + //Slicer: + int team1gender; + int team2gender; } level_locals_t; // // rxn_game.c diff --git a/reaction/game/g_main.c b/reaction/game/g_main.c index 1a34b30d..be9d0eb8 100644 --- a/reaction/game/g_main.c +++ b/reaction/game/g_main.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.75 2002/06/13 17:01:30 slicer +// Radio Gender changes according to model gender +// // Revision 1.74 2002/06/12 15:01:01 slicer // Removed g_RQ3_matchmode from USERINFO // @@ -818,6 +821,8 @@ G_InitGame void G_InitGame( int levelTime, int randomSeed, int restart ) { int i; + char model[MAX_STRING_CHARS],model2[MAX_STRING_CHARS]; + char *s; G_Printf ("------- Game Initialization -------\n"); G_Printf ("gamename: %s\n", GAMEVERSION); @@ -937,6 +942,27 @@ void G_InitGame( int levelTime, int randomSeed, int restart ) { // JBravo: reset teamplay stuff. if( g_gametype.integer == GT_TEAMPLAY ) { + + //Slicer: Default Radio Gender according to MODEL gender + Q_strncpyz(model, g_RQ3_team1model.string, sizeof(model)); + Q_strncpyz(model2, g_RQ3_team2model.string, sizeof(model)); + s = Q_strrchr(model, '/'); + if(s) + *s++ = '\0'; + s = Q_strrchr(model2, '/'); + if(s) + *s++ = '\0'; + + for (i=0; i