diff --git a/reaction/cgame/cg_players.c b/reaction/cgame/cg_players.c index 6a2985e4..c697fa6a 100644 --- a/reaction/cgame/cg_players.c +++ b/reaction/cgame/cg_players.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.35 2002/06/24 05:51:51 jbravo +// CTF mode is now semi working +// // Revision 1.34 2002/06/23 15:51:59 slicer // Fixed the UI team count cvars when someone disconnects. // @@ -405,7 +408,7 @@ static qboolean CG_FindClientModelFile(char *filename, int length, clientInfo_t if (CG_FileExists(filename)) { return qtrue; } - if (cgs.gametype == GT_TEAMPLAY) { + if (cgs.gametype == GT_TEAMPLAY || cgs.gametype == GT_CTF) { Com_sprintf(filename, length, "models/players/%s/%s_%s.%s", modelName, base, skinName, ext); } else if (cgs.gametype >= GT_TEAM) { @@ -491,7 +494,7 @@ static qboolean CG_FindClientHeadFile(char *filename, int length, clientInfo_t * if (CG_FileExists(filename)) { return qtrue; } - if (cgs.gametype == GT_TEAMPLAY) { + if (cgs.gametype == GT_TEAMPLAY || cgs.gametype == GT_CTF) { Com_sprintf(filename, length, "models/players/%s/%s_%s.%s", headModelName, base, headSkinName, ext); } else if (cgs.gametype >= GT_TEAM) { diff --git a/reaction/game/g_client.c b/reaction/game/g_client.c index 68beb415..1edfe104 100644 --- a/reaction/game/g_client.c +++ b/reaction/game/g_client.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.101 2002/06/24 05:51:51 jbravo +// CTF mode is now semi working +// // Revision 1.100 2002/06/23 23:32:29 jbravo // Fixed logging of clients IP addresses. // @@ -1057,7 +1060,7 @@ void ClientUserinfoChanged(int clientNum) Q_strncpyz(headModel, Info_ValueForKey(userinfo, "headmodel"), sizeof(headModel)); } //Com_Printf("%s model=(%s)\n",client->pers.netname, model); - if (g_gametype.integer == GT_TEAMPLAY) { + if (g_gametype.integer == GT_TEAMPLAY || g_gametype.integer == GT_CTF) { if (client->sess.sessionTeam == TEAM_RED) { Q_strncpyz(model2, g_RQ3_team1model.string, sizeof(model)); skin2 = Q_strrchr(model2, '/'); @@ -1508,7 +1511,7 @@ void ClientBegin(int clientNum) CalculateRanks(); // JBravo: default weapons - if (g_gametype.integer == GT_TEAMPLAY) { + if (g_gametype.integer == GT_TEAMPLAY || g_gametype.integer == GT_CTF) { // NiceAss: Only set it if there is no value. Fix for going into spectator resetting values. if (ent->r.svFlags & SVF_BOT) { //Makro - changed to m4/laser from pistol/kevlar @@ -1566,29 +1569,6 @@ void ClientSpawn(gentity_t * ent) index = ent - g_entities; client = ent->client; -// JBravo: Check if team spawnpoints have been located. If not find a spot for each team ala AQ2. -/* if (g_gametype.integer == GT_TEAMPLAY) { - if (!level.spawnPointsLocated) { - client->pers.initialSpawn = qfalse; - do { - level.team1spawnpoint = - SelectSpawnPoint(vec3_origin, level.team1spawn_origin, level.team1spawn_angles); - if ((level.team1spawnpoint->flags & FL_NO_BOTS) && (ent->r.svFlags & SVF_BOT)) { - continue; - } - if ((level.team1spawnpoint->flags & FL_NO_HUMANS) && !(ent->r.svFlags & SVF_BOT)) { - continue; - } - break; - } while (1); - level.team2spawnpoint = SelectRandomFurthestSpawnPoint(level.team1spawnpoint->s.origin, - level.team2spawn_origin, - level.team2spawn_angles); - level.spawnPointsLocated = qtrue; - } - } */ -// End JBravo. - // find a spawn point // do it before setting health back up, so farthest // ranging doesn't count this client @@ -1746,7 +1726,7 @@ void ClientSpawn(gentity_t * ent) //Blaze: changed WP_MACHINEGUN to WP_PISTOL, makes the base weapon you start with the pistol // JBravo: Not in TP - if (g_gametype.integer != GT_TEAMPLAY) { + if (g_gametype.integer != GT_TEAMPLAY && g_gametype.integer != GT_CTF) { client->ps.stats[STAT_WEAPONS] = (1 << WP_PISTOL); client->numClips[WP_PISTOL] = 0; client->ps.ammo[WP_PISTOL] = ClipAmountForAmmo(WP_PISTOL); @@ -1829,7 +1809,7 @@ void ClientSpawn(gentity_t * ent) client->ps.torsoAnim = TORSO_STAND; client->ps.legsAnim = LEGS_IDLE; // weapon animations - if (g_gametype.integer != GT_TEAMPLAY) + if (g_gametype.integer != GT_TEAMPLAY && g_gametype.integer != GT_CTF) client->ps.generic1 = ((client->ps.generic1 & ANIM_TOGGLEBIT) ^ ANIM_TOGGLEBIT) | WP_ANIM_IDLE; @@ -1843,7 +1823,7 @@ void ClientSpawn(gentity_t * ent) // select the highest weapon number available, after any // spawn given items have fired // JBravo: Lets make sure we have the right weapons - if (g_gametype.integer == GT_TEAMPLAY) { + if (g_gametype.integer == GT_TEAMPLAY || g_gametype.integer == GT_CTF) { EquipPlayer(ent); } else { client->ps.weapon = 1; diff --git a/reaction/game/g_cmds.c b/reaction/game/g_cmds.c index cf552151..bcd31e94 100644 --- a/reaction/game/g_cmds.c +++ b/reaction/game/g_cmds.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.145 2002/06/24 05:51:51 jbravo +// CTF mode is now semi working +// // Revision 1.144 2002/06/23 23:32:29 jbravo // Fixed logging of clients IP addresses. // @@ -1035,6 +1038,10 @@ void SetTeam(gentity_t * ent, char *s) if (g_gametype.integer == GT_TEAMPLAY) { client->sess.savedTeam = team; client->ps.persistant[PERS_SAVEDTEAM] = team; + } else if (g_gametype.integer == GT_CTF) { + client->sess.savedTeam = team; + client->ps.persistant[PERS_SAVEDTEAM] = team; + client->sess.sessionTeam = team; } else { client->sess.sessionTeam = team; } @@ -1898,8 +1905,8 @@ void Cmd_CallVote_f(gentity_t * ent) // special case for g_gametype, check for bad values if (!Q_stricmp(arg1, "g_gametype")) { i = atoi(arg2); - if (i != GT_FFA && i != GT_TEAMPLAY) { - trap_SendServerCommand(ent - g_entities, "print \"Invalid gametype. Valid gametypes are 0 and 4.\n\""); + if (i != GT_FFA && i != GT_TEAMPLAY || i != GT_CTF) { + trap_SendServerCommand(ent - g_entities, "print \"Invalid gametype. Valid gametypes are 0, 4 and 5.\n\""); return; } diff --git a/reaction/game/g_combat.c b/reaction/game/g_combat.c index 241ee82d..7398aec2 100644 --- a/reaction/game/g_combat.c +++ b/reaction/game/g_combat.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.104 2002/06/24 05:51:51 jbravo +// CTF mode is now semi working +// // Revision 1.103 2002/06/23 18:29:21 jbravo // Suicides now always gib. // @@ -1276,7 +1279,7 @@ void player_die(gentity_t * self, gentity_t * inflictor, gentity_t * attacker, i if (attacker == self) { AddScore(attacker, self->r.currentOrigin, -1); } else if (OnSameTeam(self, attacker)) { - if (level.team_round_going) { + if (g_gametype.integer == GT_TEAMPLAY && level.team_round_going) { AddScore(attacker, self->r.currentOrigin, -1); //If the kill was a TK, remove 1 from REC_KILLS to negate the one given earlyier attacker->client->pers.records[REC_KILLS]--; @@ -1285,6 +1288,13 @@ void player_die(gentity_t * self, gentity_t * inflictor, gentity_t * attacker, i Add_TeamKill(attacker); trap_SendServerCommand(self - g_entities, va("rq3_cmd %i %s", TKOK, attacker->client->pers.netname)); + } else if (g_gametype.integer == GT_CTF) { + AddScore(attacker, self->r.currentOrigin, -1); + attacker->client->pers.records[REC_KILLS]--; + attacker->client->pers.records[REC_TEAMKILLS]++; + Add_TeamKill(attacker); + trap_SendServerCommand(self - g_entities, + va("rq3_cmd %i %s", TKOK, attacker->client->pers.netname)); } } else { // Increase number of kills this life for attacker @@ -1292,13 +1302,15 @@ void player_die(gentity_t * self, gentity_t * inflictor, gentity_t * attacker, i if (g_gametype.integer == GT_TEAMPLAY) { attacker->client->killStreak++; AddScore(attacker, self->r.currentOrigin, 1); + } else if (g_gametype.integer == GT_CTF) { + attacker->client->killStreak = 0; } else { attacker->client->killStreak++; } // DM reward scoring, should add an if statement to get around this when // we add teamplay. // JBravo: Done ;) - if (g_gametype.integer != GT_TEAMPLAY) { + if (g_gametype.integer != GT_TEAMPLAY || g_gametype.integer != GT_CTF) { if (attacker->client->killStreak < 4) AddScore(attacker, self->r.currentOrigin, 1); else if (attacker->client->killStreak < 8) { @@ -1777,7 +1789,8 @@ void G_Damage(gentity_t * targ, gentity_t * inflictor, gentity_t * attacker, // JBravo: FF control if (targ != attacker && attacker && targ && targ->client && attacker->client && targ->client->sess.sessionTeam == attacker->client->sess.sessionTeam && - (!g_friendlyFire.integer && level.team_round_going)) + ((g_gametype.integer == GT_TEAMPLAY && !g_friendlyFire.integer && level.team_round_going) || + (g_gametype.integer == GT_CTF && !g_friendlyFire.integer))) return; // the intermission has allready been qualified for, so don't @@ -1981,10 +1994,10 @@ void G_Damage(gentity_t * targ, gentity_t * inflictor, gentity_t * attacker, // if the attacker was on the same team if (targ != attacker && OnSameTeam(targ, attacker)) { // JBravo: more FF tweaks - if (g_friendlyFire.integer == 2 && level.team_round_going) { + if (g_gametype.integer == GT_TEAMPLAY && g_friendlyFire.integer == 2 && level.team_round_going) { return; } - if (level.team_round_going) + if ((g_gametype.integer == GT_TEAMPLAY && level.team_round_going) || g_gametype.integer == GT_CTF) Add_TeamWound(attacker, targ, mod); } // check for godmode diff --git a/reaction/game/g_items.c b/reaction/game/g_items.c index c4cee667..877209ed 100644 --- a/reaction/game/g_items.c +++ b/reaction/game/g_items.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.42 2002/06/24 05:51:51 jbravo +// CTF mode is now semi working +// // Revision 1.41 2002/06/17 04:02:24 jbravo // Fixed weapon and item respawning after death in TP // @@ -853,12 +856,20 @@ gentity_t *LaunchItem(gitem_t * item, vec3_t origin, vec3_t velocity, int xr_fla item->giTag != WP_GRENADE && item->giTag != WP_PISTOL && item->giTag != WP_AKIMBO && item->giTag != WP_KNIFE) { dropped->think = RQ3_DroppedWeaponThink; - dropped->nextthink = level.time + RQ3_RESPAWNTIME_DEFAULT; +// JBravo: weapons and items go away faster in CTF + if (g_gametype.integer == GT_CTF) + dropped->nextthink = level.time + RQ3_CTF_RESPAWNTIME_DEFAULT; + else + dropped->nextthink = level.time + RQ3_RESPAWNTIME_DEFAULT; } //Elder: for unique items in deathmatch ... remember to condition for teamplay else if (item->giType == IT_HOLDABLE) { dropped->think = RQ3_DroppedItemThink; - dropped->nextthink = level.time + RQ3_RESPAWNTIME_DEFAULT; +// JBravo: weapons and items go away faster in CTF + if (g_gametype.integer == GT_CTF) + dropped->nextthink = level.time + RQ3_CTF_RESPAWNTIME_DEFAULT; + else + dropped->nextthink = level.time + RQ3_RESPAWNTIME_DEFAULT; } else { // auto-remove after 30 seconds dropped->think = G_FreeEntity; @@ -1092,7 +1103,8 @@ void ClearRegisteredItems(void) RegisterItem(BG_FindItemForHoldable(HI_BANDOLIER)); RegisterItem(BG_FindItemForHoldable(HI_LASER)); //Makro - all weapons should be loaded in teamplay - if (trap_Cvar_VariableIntegerValue("g_gametype") == GT_TEAMPLAY) { + //JBravo: and CTF + if (g_gametype.integer == GT_TEAMPLAY || g_gametype.integer == GT_CTF) { RegisterItem(BG_FindItemForWeapon(WP_M3)); RegisterItem(BG_FindItemForWeapon(WP_MP5)); RegisterItem(BG_FindItemForWeapon(WP_HANDCANNON)); @@ -1487,7 +1499,7 @@ void RQ3_ResetItem(int itemTag) float angle = rand() % 360; // JBravo: no resetting items in TP - if (g_gametype.integer == GT_TEAMPLAY) + if (g_gametype.integer == GT_TEAMPLAY || g_gametype.integer == GT_CTF) return; switch (itemTag) { diff --git a/reaction/game/g_local.h b/reaction/game/g_local.h index 5de6dd9a..933d4f40 100644 --- a/reaction/game/g_local.h +++ b/reaction/game/g_local.h @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.105 2002/06/24 05:51:51 jbravo +// CTF mode is now semi working +// // Revision 1.104 2002/06/23 19:25:11 niceass // bandage bug fix // @@ -301,6 +304,7 @@ typedef enum { #define SP_PODIUM_MODEL "models/mapobjects/podium/podium4.md3" #define RQ3_RESPAWNTIME_DEFAULT 60000 // Elder: time for weapons to respawn - up to 60s +#define RQ3_CTF_RESPAWNTIME_DEFAULT 10000 // JBravo: time for weapons to respawn - up to 10s #define SP_AUTOOPEN 4 // Elder: revert to Q3 behaviour #define SP_DOORTOGGLE 8 // Elder: added to enable mover toggling #define MAXDOORTIME 100 // Elder: max time the opendoor key can stay open diff --git a/reaction/game/g_main.c b/reaction/game/g_main.c index 0a84c1f8..c2ed43e6 100644 --- a/reaction/game/g_main.c +++ b/reaction/game/g_main.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.98 2002/06/24 05:51:51 jbravo +// CTF mode is now semi working +// // Revision 1.97 2002/06/23 19:12:17 slicer // More Matchmode work // @@ -695,7 +698,7 @@ void G_RegisterCvars(void) trap_Cvar_Set("g_gametype", "0"); } // JBravo: lets disable the untested modes. - if (g_gametype.integer != GT_FFA && g_gametype.integer != GT_TEAMPLAY) { + if (g_gametype.integer != GT_FFA && g_gametype.integer != GT_TEAMPLAY && g_gametype.integer != GT_CTF) { G_Printf("g_gametype %i is currently not supported by ReactionQuake3. Defaulting to 0\n", g_gametype.integer); trap_Cvar_Set("g_gametype", "0"); @@ -962,7 +965,7 @@ void G_InitGame(int levelTime, int randomSeed, int restart) } //Elder: spawn unique items. // JBravo: unless we are in Teamplay - if (g_gametype.integer != GT_TEAMPLAY) { + if (g_gametype.integer != GT_TEAMPLAY && g_gametype.integer != GT_CTF) { RQ3_StartUniqueItems(); } // Elder: force sv_floodprotect to 0 -- remove when we finish @@ -983,7 +986,7 @@ void G_InitGame(int levelTime, int randomSeed, int restart) G_SoundIndex("sound/player/gurp2.wav"); } // JBravo: reset teamplay stuff. - if (g_gametype.integer == GT_TEAMPLAY) { + if (g_gametype.integer == GT_TEAMPLAY || g_gametype.integer == GT_CTF) { //Slicer: Default Radio Gender according to MODEL gender Q_strncpyz(model, g_RQ3_team1model.string, sizeof(model)); diff --git a/reaction/game/g_spawn.c b/reaction/game/g_spawn.c index f8bdd807..7573f344 100644 --- a/reaction/game/g_spawn.c +++ b/reaction/game/g_spawn.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.34 2002/06/24 05:51:51 jbravo +// CTF mode is now semi working +// // Revision 1.33 2002/06/21 21:02:07 niceass // worldspawn laserfog check // @@ -472,12 +475,14 @@ qboolean G_CallSpawn(gentity_t * ent) if (!strcmp(item->classname, ent->classname)) { //only spawn flags in CTF mode if (item->giType == IT_TEAM && (item->giTag == PW_REDFLAG || item->giTag == PW_BLUEFLAG)) { + // JBravo: no spawning in CTF if (g_gametype.integer == GT_CTF) { G_SpawnItem(ent, item); return qtrue; } } else { - G_SpawnItem(ent, item); + if (g_gametype.integer != GT_CTF) + G_SpawnItem(ent, item); return qtrue; } } diff --git a/reaction/game/g_team.c b/reaction/game/g_team.c index b5003290..788efedd 100644 --- a/reaction/game/g_team.c +++ b/reaction/game/g_team.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.10 2002/06/24 05:51:51 jbravo +// CTF mode is now semi working +// // Revision 1.9 2002/06/16 20:06:14 jbravo // Reindented all the source files with "indent -kr -ut -i8 -l120 -lc120 -sob -bad -bap" // @@ -365,11 +368,11 @@ void Team_FragBonuses(gentity_t * targ, gentity_t * inflictor, gentity_t * attac //attacker->client->ps.persistant[PERS_DEFEND_COUNT]++; team = attacker->client->sess.sessionTeam; // add the sprite over the player's head - attacker->client->ps.eFlags &= +/* attacker->client->ps.eFlags &= ~(EF_AWARD_IMPRESSIVE | EF_AWARD_EXCELLENT | EF_AWARD_GAUNTLET | EF_AWARD_ASSIST | EF_AWARD_DEFEND | EF_AWARD_CAP); attacker->client->ps.eFlags |= EF_AWARD_DEFEND; - attacker->client->rewardTime = level.time + REWARD_SPRITE_TIME; + attacker->client->rewardTime = level.time + REWARD_SPRITE_TIME; */ return; } @@ -386,11 +389,11 @@ void Team_FragBonuses(gentity_t * targ, gentity_t * inflictor, gentity_t * attac //attacker->client->ps.persistant[PERS_DEFEND_COUNT]++; team = attacker->client->sess.sessionTeam; // add the sprite over the player's head - attacker->client->ps.eFlags &= +/* attacker->client->ps.eFlags &= ~(EF_AWARD_IMPRESSIVE | EF_AWARD_EXCELLENT | EF_AWARD_GAUNTLET | EF_AWARD_ASSIST | EF_AWARD_DEFEND | EF_AWARD_CAP); attacker->client->ps.eFlags |= EF_AWARD_DEFEND; - attacker->client->rewardTime = level.time + REWARD_SPRITE_TIME; + attacker->client->rewardTime = level.time + REWARD_SPRITE_TIME; */ return; } @@ -442,11 +445,11 @@ void Team_FragBonuses(gentity_t * targ, gentity_t * inflictor, gentity_t * attac //Blaze: Removed because it uses the persistant stats stuff //attacker->client->ps.persistant[PERS_DEFEND_COUNT]++; // add the sprite over the player's head - attacker->client->ps.eFlags &= +/* attacker->client->ps.eFlags &= ~(EF_AWARD_IMPRESSIVE | EF_AWARD_EXCELLENT | EF_AWARD_GAUNTLET | EF_AWARD_ASSIST | EF_AWARD_DEFEND | EF_AWARD_CAP); attacker->client->ps.eFlags |= EF_AWARD_DEFEND; - attacker->client->rewardTime = level.time + REWARD_SPRITE_TIME; + attacker->client->rewardTime = level.time + REWARD_SPRITE_TIME; */ return; } @@ -466,11 +469,11 @@ void Team_FragBonuses(gentity_t * targ, gentity_t * inflictor, gentity_t * attac //Blaze: Removed because it uses the persistant stats stuff //attacker->client->ps.persistant[PERS_DEFEND_COUNT]++; // add the sprite over the player's head - attacker->client->ps.eFlags &= +/* attacker->client->ps.eFlags &= ~(EF_AWARD_IMPRESSIVE | EF_AWARD_EXCELLENT | EF_AWARD_GAUNTLET | EF_AWARD_ASSIST | EF_AWARD_DEFEND | EF_AWARD_CAP); attacker->client->ps.eFlags |= EF_AWARD_DEFEND; - attacker->client->rewardTime = level.time + REWARD_SPRITE_TIME; + attacker->client->rewardTime = level.time + REWARD_SPRITE_TIME; */ return; } @@ -712,11 +715,11 @@ int Team_TouchOurFlag(gentity_t * ent, gentity_t * other, int team) other->client->pers.teamState.captures++; // add the sprite over the player's head - other->client->ps.eFlags &= +/* other->client->ps.eFlags &= ~(EF_AWARD_IMPRESSIVE | EF_AWARD_EXCELLENT | EF_AWARD_GAUNTLET | EF_AWARD_ASSIST | EF_AWARD_DEFEND | EF_AWARD_CAP); other->client->ps.eFlags |= EF_AWARD_CAP; - other->client->rewardTime = level.time + REWARD_SPRITE_TIME; + other->client->rewardTime = level.time + REWARD_SPRITE_TIME; */ //Blaze: Removed because it uses the persistant stats stuff //other->client->ps.persistant[PERS_CAPTURES]++; @@ -745,11 +748,11 @@ int Team_TouchOurFlag(gentity_t * ent, gentity_t * other, int team) //Blaze: Removed because it uses the persistant stats stuff //player->client->ps.persistant[PERS_ASSIST_COUNT]++; // add the sprite over the player's head - player->client->ps.eFlags &= +/* player->client->ps.eFlags &= ~(EF_AWARD_IMPRESSIVE | EF_AWARD_EXCELLENT | EF_AWARD_GAUNTLET | EF_AWARD_ASSIST | EF_AWARD_DEFEND | EF_AWARD_CAP); player->client->ps.eFlags |= EF_AWARD_ASSIST; - player->client->rewardTime = level.time + REWARD_SPRITE_TIME; + player->client->rewardTime = level.time + REWARD_SPRITE_TIME; */ } else if (player->client->pers.teamState.lastfraggedcarrier + CTF_FRAG_CARRIER_ASSIST_TIMEOUT > level.time) { @@ -758,11 +761,11 @@ int Team_TouchOurFlag(gentity_t * ent, gentity_t * other, int team) //Blaze: Removed because it uses the persistant stats stuff //player->client->ps.persistant[PERS_ASSIST_COUNT]++; // add the sprite over the player's head - player->client->ps.eFlags &= +/* player->client->ps.eFlags &= ~(EF_AWARD_IMPRESSIVE | EF_AWARD_EXCELLENT | EF_AWARD_GAUNTLET | EF_AWARD_ASSIST | EF_AWARD_DEFEND | EF_AWARD_CAP); player->client->ps.eFlags |= EF_AWARD_ASSIST; - player->client->rewardTime = level.time + REWARD_SPRITE_TIME; + player->client->rewardTime = level.time + REWARD_SPRITE_TIME; */ } } } diff --git a/reaction/game/g_teamplay.c b/reaction/game/g_teamplay.c index 4abf28b3..aa8f16b9 100644 --- a/reaction/game/g_teamplay.c +++ b/reaction/game/g_teamplay.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.114 2002/06/24 05:51:51 jbravo +// CTF mode is now semi working +// // Revision 1.113 2002/06/22 00:19:57 jbravo // Cleanups for colors and stopped bots looking for team leaders in TP // @@ -1479,10 +1482,17 @@ void RQ3_Cmd_Radio_f(gentity_t * ent) continue; if (IsInIgnoreList(player, ent)) continue; - if (player->client->sess.savedTeam == ent->client->sess.savedTeam) - trap_SendServerCommand(player - g_entities, - va("rq3_cmd %i %i %i\n", RADIO, - kills - 1, ent->client->radioGender)); + if (g_gametype.integer != GT_TEAMPLAY) { + if (player->client->sess.sessionTeam == ent->client->sess.sessionTeam) + trap_SendServerCommand(player - g_entities, + va("rq3_cmd %i %i %i\n", RADIO, + kills - 1, ent->client->radioGender)); + } else { + if (player->client->sess.savedTeam == ent->client->sess.savedTeam) + trap_SendServerCommand(player - g_entities, + va("rq3_cmd %i %i %i\n", RADIO, + kills - 1, ent->client->radioGender)); + } } } } @@ -1492,16 +1502,30 @@ void RQ3_Cmd_Radio_f(gentity_t * ent) continue; if (IsInIgnoreList(player, ent)) continue; - if (player->client->sess.savedTeam == ent->client->sess.savedTeam) { - if (player->r.svFlags & SVF_BOT) - trap_SendServerCommand(player - g_entities, - va("print \"radio %s %s\n\"", - ent->client->pers.netname, - radio_msgs[x].msg)); - else - trap_SendServerCommand(player - g_entities, - va("rq3_cmd %i %i %i\n", RADIO, x, - ent->client->radioGender)); + if (g_gametype.integer != GT_TEAMPLAY) { + if (player->client->sess.sessionTeam == ent->client->sess.sessionTeam) { + if (player->r.svFlags & SVF_BOT) + trap_SendServerCommand(player - g_entities, + va("print \"radio %s %s\n\"", + ent->client->pers.netname, + radio_msgs[x].msg)); + else + trap_SendServerCommand(player - g_entities, + va("rq3_cmd %i %i %i\n", RADIO, x, + ent->client->radioGender)); + } + } else { + if (player->client->sess.savedTeam == ent->client->sess.savedTeam) { + if (player->r.svFlags & SVF_BOT) + trap_SendServerCommand(player - g_entities, + va("print \"radio %s %s\n\"", + ent->client->pers.netname, + radio_msgs[x].msg)); + else + trap_SendServerCommand(player - g_entities, + va("rq3_cmd %i %i %i\n", RADIO, x, + ent->client->radioGender)); + } } } //Slicer lets return to stop the while if found.. diff --git a/reaction/game/g_weapon.c b/reaction/game/g_weapon.c index 8f605a0c..0c3f6fc3 100644 --- a/reaction/game/g_weapon.c +++ b/reaction/game/g_weapon.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.69 2002/06/24 05:51:51 jbravo +// CTF mode is now semi working +// // Revision 1.68 2002/06/24 01:21:26 blaze // changed HC to be more like aq2. Probably more work needed // @@ -1318,7 +1321,7 @@ void Weapon_Knife_Fire(gentity_t * ent) //m = Knife_Throw(ent, muzzle, forward, THROW_DAMAGE, 1200); // JBravo: ff - if (g_gametype.integer == GT_TEAMPLAY) + if (g_gametype.integer == GT_TEAMPLAY || g_gametype.integer == GT_CTF) setFFState(ent); m = fire_knife(ent, muzzle, forward); // m->damage *= s_quadFactor; @@ -1350,7 +1353,7 @@ void Weapon_M4_Fire(gentity_t * ent) } // JBravo: ff - if (g_gametype.integer == GT_TEAMPLAY) + if (g_gametype.integer == GT_TEAMPLAY || g_gametype.integer == GT_CTF) setFFState(ent); Bullet_Fire(ent, RQ3_Spread(ent, M4_SPREAD), M4_DAMAGE, MOD_M4); @@ -1385,7 +1388,7 @@ void Weapon_MK23_Fire(gentity_t * ent) spread = PISTOL_SPREAD; } // JBravo: ff - if (g_gametype.integer == GT_TEAMPLAY) + if (g_gametype.integer == GT_TEAMPLAY || g_gametype.integer == GT_CTF) setFFState(ent); Bullet_Fire(ent, RQ3_Spread(ent, spread), PISTOL_DAMAGE, MOD_PISTOL); } @@ -1406,7 +1409,7 @@ void Weapon_SSG3000_FireOld(gentity_t * ent) spread = RQ3_Spread(ent, SNIPER_SPREAD); } // JBravo: ff - if (g_gametype.integer == GT_TEAMPLAY) + if (g_gametype.integer == GT_TEAMPLAY || g_gametype.integer == GT_CTF) setFFState(ent); Bullet_Fire(ent, spread, SNIPER_DAMAGE, MOD_SNIPER); @@ -1725,7 +1728,7 @@ void Weapon_MP5_Fire(gentity_t * ent) } // JBravo: ff - if (g_gametype.integer == GT_TEAMPLAY) + if (g_gametype.integer == GT_TEAMPLAY || g_gametype.integer == GT_CTF) setFFState(ent); Bullet_Fire(ent, RQ3_Spread(ent, MP5_SPREAD), MP5_DAMAGE, MOD_MP5); @@ -1741,7 +1744,7 @@ void Weapon_HandCannon_Fire(gentity_t * ent) gentity_t *tent, *tent2; // JBravo: ff - if (g_gametype.integer == GT_TEAMPLAY) + if (g_gametype.integer == GT_TEAMPLAY || g_gametype.integer == GT_CTF) setFFState(ent); //Elder: added for damage report RQ3_InitShotgunDamageReport(); @@ -1780,7 +1783,7 @@ void Weapon_M3_Fire(gentity_t * ent) gentity_t *tent; // JBravo: ff - if (g_gametype.integer == GT_TEAMPLAY) + if (g_gametype.integer == GT_TEAMPLAY || g_gametype.integer == GT_CTF) setFFState(ent); //Elder: added for damage report RQ3_InitShotgunDamageReport(); @@ -1876,7 +1879,7 @@ void Weapon_Akimbo_Fire(gentity_t * ent) //Blaze: Will need 2 of these spread = AKIMBO_SPREAD; // JBravo: ff - if (g_gametype.integer == GT_TEAMPLAY) + if (g_gametype.integer == GT_TEAMPLAY || g_gametype.integer == GT_CTF) setFFState(ent); Bullet_Fire(ent, RQ3_Spread(ent, spread), AKIMBO_DAMAGE, MOD_AKIMBO); @@ -1904,7 +1907,7 @@ void Weapon_Grenade_Fire(gentity_t * ent) VectorNormalize(forward); // JBravo: ff - if (g_gametype.integer == GT_TEAMPLAY) + if (g_gametype.integer == GT_TEAMPLAY || g_gametype.integer == GT_CTF) setFFState(ent); m = fire_grenade(ent, muzzle, forward); //Elder: removed