More radio tewaks and cleanups.

This commit is contained in:
Richard Allen 2002-03-17 03:35:29 +00:00
parent 143e3793ff
commit 440d611d96
4 changed files with 28 additions and 147 deletions

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.23 2002/03/17 03:35:29 jbravo
// More radio tewaks and cleanups.
//
// Revision 1.22 2002/03/14 16:04:26 slicer
// Optimization on radio parsing
//
@ -1263,153 +1266,19 @@ static void CG_ServerCommand( void ) {
CG_AddBufferedSound(cgs.media.actionSound);
return;
}
// JBravo: radio. This implementation sucks.
// JBravo: radio. This implementation rules. Used to suck :)
if (!strcmp(cmd, "playradiosound")) {
int sound, gender;
sound = atoi(CG_Argv(1));
gender = atoi(CG_Argv(2));
//Slicer optimization
if(!gender) CG_AddBufferedSound(cgs.media.male_sounds[sound]);
else
if(!gender) {
CG_AddBufferedSound(cgs.media.male_sounds[sound]);
} else {
CG_AddBufferedSound(cgs.media.female_sounds[sound]);
return;
/*
if (sound == 0) {
if (!gender)
CG_AddBufferedSound(cgs.media.male_1sound);
else
CG_AddBufferedSound(cgs.media.female_1sound);
} else if (sound == 1) {
if (!gender)
CG_AddBufferedSound(cgs.media.male_2sound);
else
CG_AddBufferedSound(cgs.media.female_2sound);
} else if (sound == 2) {
if (!gender)
CG_AddBufferedSound(cgs.media.male_3sound);
else
CG_AddBufferedSound(cgs.media.female_3sound);
} else if (sound == 3) {
if (!gender)
CG_AddBufferedSound(cgs.media.male_4sound);
else
CG_AddBufferedSound(cgs.media.female_4sound);
} else if (sound == 4) {
if (!gender)
CG_AddBufferedSound(cgs.media.male_5sound);
else
CG_AddBufferedSound(cgs.media.female_5sound);
} else if (sound == 5) {
if (!gender)
CG_AddBufferedSound(cgs.media.male_6sound);
else
CG_AddBufferedSound(cgs.media.female_6sound);
} else if (sound == 6) {
if (!gender)
CG_AddBufferedSound(cgs.media.male_7sound);
else
CG_AddBufferedSound(cgs.media.female_7sound);
} else if (sound == 7) {
if (!gender)
CG_AddBufferedSound(cgs.media.male_8sound);
else
CG_AddBufferedSound(cgs.media.female_8sound);
} else if (sound == 8) {
if (!gender)
CG_AddBufferedSound(cgs.media.male_9sound);
else
CG_AddBufferedSound(cgs.media.female_9sound);
} else if (sound == 9) {
if (!gender)
CG_AddBufferedSound(cgs.media.male_10sound);
else
CG_AddBufferedSound(cgs.media.female_10sound);
} else if (sound == 10) {
if (!gender)
CG_AddBufferedSound(cgs.media.male_backsound);
else
CG_AddBufferedSound(cgs.media.female_backsound);
} else if (sound == 11) {
if (!gender)
CG_AddBufferedSound(cgs.media.male_coversound);
else
CG_AddBufferedSound(cgs.media.female_coversound);
} else if (sound == 12) {
if (!gender)
CG_AddBufferedSound(cgs.media.male_downsound);
else
CG_AddBufferedSound(cgs.media.female_downsound);
} else if (sound == 13) {
if (!gender)
CG_AddBufferedSound(cgs.media.male_enemydsound);
else
CG_AddBufferedSound(cgs.media.female_enemydsound);
} else if (sound == 14) {
if (!gender)
CG_AddBufferedSound(cgs.media.male_enemyssound);
else
CG_AddBufferedSound(cgs.media.female_enemyssound);
} else if (sound == 15) {
if (!gender)
CG_AddBufferedSound(cgs.media.male_forwardsound);
else
CG_AddBufferedSound(cgs.media.female_forwardsound);
} else if (sound == 16) {
if (!gender)
CG_AddBufferedSound(cgs.media.male_gosound);
else
CG_AddBufferedSound(cgs.media.female_gosound);
} else if (sound == 17) {
if (!gender)
CG_AddBufferedSound(cgs.media.male_im_hitsound);
else
CG_AddBufferedSound(cgs.media.female_im_hitsound);
} else if (sound == 18) {
if (!gender)
CG_AddBufferedSound(cgs.media.male_leftsound);
else
CG_AddBufferedSound(cgs.media.female_leftsound);
} else if (sound == 19) {
if (!gender)
CG_AddBufferedSound(cgs.media.male_reportinsound);
else
CG_AddBufferedSound(cgs.media.female_reportinsound);
} else if (sound == 20) {
if (!gender)
CG_AddBufferedSound(cgs.media.male_rightsound);
else
CG_AddBufferedSound(cgs.media.female_rightsound);
} else if (sound == 21) {
if (!gender)
CG_AddBufferedSound(cgs.media.male_taking_fsound);
else
CG_AddBufferedSound(cgs.media.female_taking_fsound);
} else if (sound == 22) {
if (!gender)
CG_AddBufferedSound(cgs.media.male_teamdownsound);
else
CG_AddBufferedSound(cgs.media.female_teamdownsound);
} else if (sound == 23) {
if (!gender)
CG_AddBufferedSound(cgs.media.male_treportsound);
else
CG_AddBufferedSound(cgs.media.female_treportsound);
} else if (sound == 24) {
if (!gender)
CG_AddBufferedSound(cgs.media.male_upsound);
else
CG_AddBufferedSound(cgs.media.female_upsound);
} else if (sound == 25) {
if (!gender)
CG_AddBufferedSound(cgs.media.male_click);
else
CG_AddBufferedSound(cgs.media.female_click);
}
return;
*/
}
CG_Printf( "Unknown client game command: %s\n", cmd );

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.51 2002/03/17 03:35:29 jbravo
// More radio tewaks and cleanups.
//
// Revision 1.50 2002/03/14 23:54:12 jbravo
// Added a variable system from AQ. Works the same except it uses $ for %
//
@ -836,7 +839,7 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
// Increase number of kills this life for attacker
// JBravo: unless we are in teamplay
if (g_gametype.integer == GT_TEAMPLAY) {
attacker->client->killStreak = 0;
attacker->client->killStreak++;
AddScore(attacker, self->r.currentOrigin, 1);
} else {
attacker->client->killStreak++;

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.54 2002/03/17 03:35:29 jbravo
// More radio tewaks and cleanups.
//
// Revision 1.53 2002/03/17 00:40:23 jbravo
// Adding variable team names. g_RQ3_team1name and g_RQ3_team2name. Fixed
// Slicers fraglimit check.
@ -89,6 +92,9 @@
#define BODY_QUEUE_SIZE 8
// JBravo: Max number of killed enemys to track
#define RQ3_MAXKILLS 5
// Blaze: How long someone bleeds for
// Elder: This doesn't work the same as Q2 because clients and servers can
// run independent "clocks." Normal servers send snapshots every 50ms

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.36 2002/03/17 03:35:29 jbravo
// More radio tewaks and cleanups.
//
// Revision 1.35 2002/03/17 01:55:43 jbravo
// Fixed a small bug in radio enemyd that made it say "one enemu down"
//
@ -972,8 +975,8 @@ void RQ3_Cmd_Radio_f(gentity_t *ent)
while (Q_stricmp(radio_msgs[x].msg, "END")) {
if (!Q_stricmp(radio_msgs[x].msg, msg)) {
if (!Q_stricmp(radio_msgs[x].msg, "enemyd")) {
kills = ReadKilledPlayers (ent);
ResetKills (ent);
kills = ent->client->killStreak;
ent->client->killStreak = 0;
if (kills >1 && kills <10) {
for (i = 0; i < level.maxclients; i++) {
player = &g_entities[i];
@ -981,7 +984,7 @@ void RQ3_Cmd_Radio_f(gentity_t *ent)
continue;
if (player->client->sess.savedTeam == ent->client->sess.savedTeam)
trap_SendServerCommand(player-g_entities, va("playradiosound %i %i\n\"",
kills, ent->client->radioGender));
kills-1, ent->client->radioGender));
}
}
}
@ -1126,7 +1129,7 @@ void ResetKills (gentity_t * ent)
{
int i;
for (i = 0; i < 5; i++) {
for (i = 0; i < RQ3_MAXKILLS; i++) {
ent->client->lastkilled_client[i] = NULL;
}
}
@ -1136,9 +1139,9 @@ int ReadKilledPlayers (gentity_t * ent)
int results, i;
results = -1;
if (ent->client->lastkilled_client[0]) {
for (i = 0; i < 5; i++) {
if (ent->client->lastkilled_client[i]) {
if (ent->client->lastkilled_client[0] != NULL) {
for (i = 0; i < RQ3_MAXKILLS; i++) {
if (ent->client->lastkilled_client[i] != NULL) {
results++;
}
}
@ -1152,7 +1155,7 @@ void AddKilledPlayer (gentity_t * self, gentity_t * ent)
int kills;
kills = ReadKilledPlayers (self);
if (kills == 5 || kills == -1) {
if (kills == RQ3_MAXKILLS || kills == -1) {
self->client->lastkilled_client[0] = ent;
} else {
self->client->lastkilled_client[kills + 1] = ent;