Fixed my weaponchange cancel in the Use cmd, and fixed the bug where players

that where in eye spectating someone moved on to another player instantly on death.
This commit is contained in:
Richard Allen 2002-07-04 04:20:41 +00:00
parent 7c53ea9822
commit 29a3e992bb
5 changed files with 101 additions and 179 deletions

View file

@ -5,6 +5,10 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.150 2002/07/04 04:20:41 jbravo
// Fixed my weaponchange cancel in the Use cmd, and fixed the bug where players
// that where in eye spectating someone moved on to another player instantly on death.
//
// Revision 1.149 2002/07/02 20:22:35 jbravo
// Changed the files to use the right ui.
//
@ -1334,13 +1338,8 @@ static void G_SayTo(gentity_t * ent, gentity_t * other, int mode, int color, con
if (IsInIgnoreList(other, ent))
return;
// JBravo: Dead people dont speak to the living... or so Im told.
if (ent->client->sess.sessionTeam == TEAM_SPECTATOR &&
(other->client->sess.sessionTeam == TEAM_RED ||
other->client->sess.sessionTeam == TEAM_BLUE) &&
level.team_round_going && g_gametype.integer == GT_TEAMPLAY) {
if (ent->health <= 0 && other->health > 0 && g_gametype.integer == GT_TEAMPLAY && level.team_round_going)
return;
}
trap_SendServerCommand(other - g_entities, va("%s \"%s%c%c%s\"",
mode == SAY_TEAM ? "tchat" : "chat",
name, Q_COLOR_ESCAPE, color, message));
@ -2686,6 +2685,8 @@ void ClientCommand(int clientNum)
MM_TeamModel_f(ent);
else if (Q_stricmp(cmd, "referee") == 0)
MM_Referee_f(ent);
else if (Q_stricmp(cmd, "settings") == 0)
MM_Settings_f(ent);
// aasimon: referee for MM
else if (Q_stricmp(cmd, "reflogin") == 0)
Ref_Auth(ent);

View file

@ -5,6 +5,10 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.108 2002/07/04 04:20:41 jbravo
// Fixed my weaponchange cancel in the Use cmd, and fixed the bug where players
// that where in eye spectating someone moved on to another player instantly on death.
//
// Revision 1.107 2002/07/02 03:41:59 jbravo
// Fixed a 2 frags pr kill bug, the use cmd now cancels weaponchanges in progress
// and fixed the captain status lingering on people after switching from MM
@ -526,7 +530,7 @@ void body_die(gentity_t * self, gentity_t * inflictor, gentity_t * attacker, int
return;
}
if (attacker->client && level.team_round_going)
if (attacker->client && (g_gametype.integer == GT_TEAMPLAY && level.team_round_going) || g_gametype.integer != GT_TEAMPLAY)
attacker->client->pers.records[REC_GIBSHOTS]++;
GibEntity(self, 0);
@ -1141,7 +1145,7 @@ void player_die(gentity_t * self, gentity_t * inflictor, gentity_t * attacker, i
killer = ENTITYNUM_WORLD;
killerName = "<world>";
// Elder: Statistics tracking
if (level.team_round_going)
if ((g_gametype.integer == GT_TEAMPLAY && level.team_round_going) || g_gametype.integer != GT_TEAMPLAY)
self->client->pers.records[REC_WORLDDEATHS]++;
}
@ -1410,10 +1414,8 @@ void player_die(gentity_t * self, gentity_t * inflictor, gentity_t * attacker, i
// or they would get stale scoreboards
for (i = 0; i < level.maxclients; i++) {
gclient_t *client;
gentity_t *follower;
client = &level.clients[i];
follower = &g_entities[i];
if (client->pers.connected != CON_CONNECTED) {
continue;
@ -1422,13 +1424,9 @@ void player_die(gentity_t * self, gentity_t * inflictor, gentity_t * attacker, i
continue;
}
// JBravo: make clients that are following this one stop following.
if (client->sess.spectatorClient == self->s.number) {
if (g_gametype.integer == GT_TEAMPLAY) {
if (client->sess.spectatorState == SPECTATOR_FOLLOW)
Cmd_FollowCycle_f(follower, 1);
} else {
Cmd_Score_f(g_entities + i);
}
// JBravo: Moved the code to move followers over to MakeSpectator.
if (g_gametype.integer != GT_TEAMPLAY) {
Cmd_Score_f(g_entities + i);
}
}

View file

@ -18,6 +18,7 @@ void MM_ClearScores(void);
void MM_TeamName_f(gentity_t *);
void MM_TeamModel_f(gentity_t *);
void MM_Referee_f(gentity_t *);
void MM_Settings_f(gentity_t *);
void SendEndMessage();
// aasimon: Declarations for Ref system

View file

@ -5,6 +5,10 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.121 2002/07/04 04:20:41 jbravo
// Fixed my weaponchange cancel in the Use cmd, and fixed the bug where players
// that where in eye spectating someone moved on to another player instantly on death.
//
// Revision 1.120 2002/07/02 18:30:53 makro
// Fixed bug with akimbo/pistol clips in TP
//
@ -1190,11 +1194,26 @@ void UnstickPlayer(gentity_t * ent)
void MakeSpectator(gentity_t * ent)
{
gclient_t *client;
gentity_t *follower;
int i;
client = ent->client;
if (!client->gibbed || ent->s.eType != ET_INVISIBLE)
CopyToBodyQue(ent);
for (i = 0; i < level.maxclients; i++) {
follower = &g_entities[i];
if (!follower->inuse || !follower->client)
continue;
if (follower->client->pers.connected != CON_CONNECTED)
continue;
if (follower->client->sess.sessionTeam != TEAM_SPECTATOR)
continue;
if (follower->client->sess.spectatorClient == ent->s.number &&
follower->client->sess.spectatorState == SPECTATOR_FOLLOW)
Cmd_FollowCycle_f(follower, 1);
}
client->weaponCount[ent->client->ps.weapon] = 0;
client->ps.stats[STAT_WEAPONS] = 0;
client->sess.sessionTeam = TEAM_SPECTATOR;
@ -1296,117 +1315,63 @@ void RQ3_Cmd_Radiogender_f(gentity_t * ent)
}
radio_msg_t male_radio_msgs[] = {
{"1", 6}
,
{"2", 6}
,
{"3", 8}
,
{"4", 7}
,
{"5", 8}
,
{"6", 9}
,
{"7", 8}
,
{"8", 7}
,
{"9", 7}
,
{"10", 6}
,
{"back", 6}
,
{"cover", 7}
,
{"down", 13}
,
{"enemyd", 10}
,
{"enemys", 9}
,
{"forward", 6}
,
{"go", 6}
,
{"im_hit", 7}
,
{"left", 7}
,
{"reportin", 9}
,
{"right", 6}
,
{"taking_f", 22}
,
{"teamdown", 13}
,
{"treport", 12}
,
{"up", 4}
,
{"click", 4}
,
{"END", 0}
, // end of list delimiter
{"1", 6},
{"2", 6},
{"3", 8},
{"4", 7},
{"5", 8},
{"6", 9},
{"7", 8},
{"8", 7},
{"9", 7},
{"10", 6},
{"back", 6},
{"cover", 7},
{"down", 13},
{"enemyd", 10},
{"enemys", 9},
{"forward", 6},
{"go", 6},
{"im_hit", 7},
{"left", 7},
{"reportin", 9},
{"right", 6},
{"taking_f", 22},
{"teamdown", 13},
{"treport", 12},
{"up", 4},
{"click", 4},
{"END", 0}, // end of list delimiter
};
radio_msg_t female_radio_msgs[] = {
{"1", 5}
,
{"2", 5}
,
{"3", 5}
,
{"4", 5}
,
{"5", 5}
,
{"6", 8}
,
{"7", 7}
,
{"8", 5}
,
{"9", 5}
,
{"10", 5}
,
{"back", 6}
,
{"cover", 5}
,
{"down", 6}
,
{"enemyd", 9}
,
{"enemys", 9}
,
{"forward", 8}
,
{"go", 6}
,
{"im_hit", 7}
,
{"left", 8}
,
{"reportin", 9}
,
{"right", 5}
,
{"taking_f", 22}
,
{"teamdown", 10}
,
{"treport", 12}
,
{"up", 6}
,
{"click", 6}
,
{"END", 0}
, // end of list delimiter
{"1", 5},
{"2", 5},
{"3", 5},
{"4", 5},
{"5", 5},
{"6", 8},
{"7", 7},
{"8", 5},
{"9", 5},
{"10", 5},
{"back", 6},
{"cover", 5},
{"down", 6},
{"enemyd", 9},
{"enemys", 9},
{"forward", 8},
{"go", 6},
{"im_hit", 7},
{"left", 8},
{"reportin", 9},
{"right", 5},
{"taking_f", 22},
{"teamdown", 10},
{"treport", 12},
{"up", 6},
{"click", 6},
{"END", 0}, // end of list delimiter
};
//Slicer Adding Flood Protection Functions
@ -1484,7 +1449,7 @@ void RQ3_Cmd_Radio_f(gentity_t * ent)
gentity_t *player;
int i, x, kills;
if (ent->client->sess.sessionTeam == TEAM_SPECTATOR)
if (ent->client->sess.sessionTeam == TEAM_SPECTATOR || ent->health <= 0)
return;
if (trap_Argc() < 2)
return;
@ -1973,7 +1938,9 @@ void RQ3_Cmd_Use_f(gentity_t * ent)
if (weapon != WP_NONE) {
if (weapon == ent->client->ps.weapon)
return;
trap_SendServerCommand(ent - g_entities, va("rq3_cmd %i %i", SETWEAPON, weapon));
G_Printf("ps.weapon = %i, ps.weaponTime = %i\n", ent->client->ps.weapon, ent->client->ps.weaponTime);
if (ent->client->ps.weaponTime == 0)
trap_SendServerCommand(ent - g_entities, va("rq3_cmd %i %i", SETWEAPON, weapon));
Com_sprintf(buf, sizeof(buf), "stuff weapon %d\n", weapon);
trap_SendServerCommand(ent - g_entities, buf);
return;
@ -2050,7 +2017,8 @@ void RQ3_Cmd_Use_f(gentity_t * ent)
}
if (weapon == ent->client->ps.weapon)
return;
trap_SendServerCommand(ent - g_entities, va("rq3_cmd %i %i", SETWEAPON, weapon));
if (ent->client->ps.weaponTime == 0)
trap_SendServerCommand(ent - g_entities, va("rq3_cmd %i %i", SETWEAPON, weapon));
Com_sprintf(buf, sizeof(buf), "stuff weapon %d\n", weapon);
trap_SendServerCommand(ent - g_entities, buf);
}

View file

@ -5,6 +5,10 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.15 2002/07/04 04:20:41 jbravo
// Fixed my weaponchange cancel in the Use cmd, and fixed the bug where players
// that where in eye spectating someone moved on to another player instantly on death.
//
// Revision 1.14 2002/06/16 20:06:14 jbravo
// Reindented all the source files with "indent -kr -ut -i8 -l120 -lc120 -sob -bad -bap"
//
@ -191,18 +195,6 @@ static float asinf(float x)
static camera_t cameras[MAX_CLIENTS];
/* local functions */
/*
// JBravo: Not used anymore.
static void CameraShowMode (gentity_t *ent)
{
if (ent->client->camera->mode == CAMERA_MODE_SWING)
ent->client->camera->swing_msg_time = level.time + SWING_MSG_TIME;
trap_SendServerCommand( ent->client->ps.clientNum,
va("cp \"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" S_COLOR_MAGENTA "Camera Mode-" S_COLOR_YELLOW"%s\n",
(ent->client->camera->mode == CAMERA_MODE_FLIC)? "FLIC":"SWING") );
}
*/
static gentity_t *ClosestVisible(gentity_t * ent, float maxrange, qboolean pvs)
{
@ -236,28 +228,17 @@ static int NumPlayers(void)
{
int i, count = 0;
// gentity_t *current;
for (i = 0; i < level.maxclients; i++) {
// JBravo: zcam team fixes
/* if (g_gametype.integer == GT_TEAMPLAY) {
if (level.clients[i].pers.connected == CON_CONNECTED
&& level.clients[i].sess.savedTeam != TEAM_SPECTATOR) {
count ++;
}
} else { */
if (level.clients[i].pers.connected == CON_CONNECTED
&& level.clients[i].sess.sessionTeam != TEAM_SPECTATOR) {
count++;
}
// }
}
return count;
}
static void PointCamAtOrigin(gentity_t * ent, vec3_t location)
{
// int i;
vec3_t diff, angles;
VectorSubtract(location, ent->client->ps.origin, diff);
@ -267,7 +248,6 @@ static void PointCamAtOrigin(gentity_t * ent, vec3_t location)
static void PointCamAtTarget(gentity_t * ent)
{
// int i;
vec3_t diff, angles;
float difference;
@ -333,12 +313,10 @@ static void FindCamPos(gentity_t * ent, float angle, vec3_t offset_position, vec
static void RepositionAtTarget(gentity_t * ent, vec3_t offset_position)
{
// int i;
vec3_t diff;
vec3_t cam_pos;
trace_t trace;
// camera_t *camera;
qboolean snapto = qfalse; // snapto towards target when jumping to new position
ent->client->camera->flic_watching_the_wall = qfalse;
@ -437,7 +415,6 @@ static void RepositionAtTarget(gentity_t * ent, vec3_t offset_position)
static void RepositionAtOrigin(gentity_t * ent, vec3_t offset_position)
{
// int i;
vec3_t cam_pos;
trace_t trace;
@ -524,7 +501,6 @@ static void SwitchToNewTarget(gentity_t * ent, gentity_t * new_target)
static void CameraFlicThink(gentity_t * ent)
{
// int clientID;
vec3_t camera_offset;
int num_visible;
gentity_t *new_target;
@ -634,7 +610,6 @@ void CameraFlicBegin(gentity_t * ent)
static void CameraStaticThink(gentity_t * ent)
{
// int i;
trace_t trace;
vec3_t end_floor, end_ceiling;
static vec3_t mins = { -4, -4, -4 };
@ -898,9 +873,6 @@ static void CameraSwingThink(gentity_t * ent)
gentity_t *target;
vec3_t forward, right;
trace_t trace;
// trace_t trace_left, trace_right;
// int i;
vec3_t oldgoal;
vec3_t angles;
vec3_t viewangles;
@ -1102,25 +1074,7 @@ void camera_disconnect(gentity_t * ent)
void camera_think(gentity_t * ent)
{
/* if ( (ent->client->buttons & BUTTON_ATTACK )
&& ! (ent->client->oldbuttons & BUTTON_ATTACK ) )
{
CameraSwingCycle (ent, 1);
}
if ( (ent->client->buttons & BUTTON_USE_HOLDABLE )
&& ! (ent->client->oldbuttons & BUTTON_USE_HOLDABLE ) )
{
if (ent->client->camera->mode == CAMERA_MODE_FLIC)
{
CameraSwingCycle (ent, 1);
}
else
{
CameraFlicBegin (ent);
}
} */
// JBravo: removed zcam mode switching code. Handled AQ style in g_active.c
if (NumPlayers() == 0) {
CameraStaticThink(ent);
return;