fixed spectating so ref\'s can now use all the chasecam modes.

This commit is contained in:
Scott Brooks 2002-09-24 05:06:17 +00:00
parent 300c39a81c
commit 746bd5be1e
9 changed files with 114 additions and 9 deletions

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.89 2002/09/24 05:06:16 blaze
// fixed spectating so ref\'s can now use all the chasecam modes.
//
// Revision 1.88 2002/08/30 01:09:06 jbravo
// Semi fixed the bodies thing in CTB
//
@ -376,6 +379,8 @@ void ClientImpacts(gentity_t * ent, pmove_t * pm)
if (j != i) {
continue; // duplicated
}
//Blaze: Print out some debug info
if (&g_entities[pm->touchents[i]] == NULL) G_Printf("Ln 0377\n");
other = &g_entities[pm->touchents[i]];
if ((ent->r.svFlags & SVF_BOT) && (ent->touch)) {
@ -426,6 +431,9 @@ void G_TouchTriggers(gentity_t * ent)
VectorAdd(ent->client->ps.origin, ent->r.maxs, maxs);
for (i = 0; i < num; i++) {
//Blaze: Print out some debug info
if (&g_entities[touch[i]] == NULL) G_Printf("Ln 0429\n");
hit = &g_entities[touch[i]];
if (!hit->touch && !ent->touch) {
@ -552,7 +560,7 @@ void SpectatorThink(gentity_t * ent, usercmd_t * ucmd)
// Attack Button cycles throught free view, follow or zcam
if ((ucmd->buttons & BUTTON_ATTACK) && !(client->oldbuttons & BUTTON_ATTACK)) {
if (g_gametype.integer == GT_TEAMPLAY && g_RQ3_limchasecam.integer != 0) {
if (g_gametype.integer == GT_TEAMPLAY && g_RQ3_limchasecam.integer != 0 && client->sess.referee == 0 ) {
if (!OKtoFollow(clientNum))
return;
if (client->sess.spectatorState != SPECTATOR_FOLLOW) {
@ -742,7 +750,10 @@ void ClientEvents(gentity_t * ent, int oldEventSequence)
ent->client->ps.damageEvent++;
ent->client->ps.damageCount += damage;
if (ent->client->lasthurt_mod != 0) {
G_Damage(ent, &g_entities[ent->client->lasthurt_client],
//Blaze: Print out some debug info
if (&g_entities[ent->client->lasthurt_client] == NULL) G_Printf("Ln 0748\n");
G_Damage(ent, &g_entities[ent->client->lasthurt_client],
&g_entities[ent->client->lasthurt_client], NULL, NULL, damage, 0, MOD_FALLING);
} else {
G_Damage(ent, NULL, NULL, NULL, NULL, damage, 0, MOD_FALLING);
@ -770,6 +781,9 @@ void ClientEvents(gentity_t * ent, int oldEventSequence)
ent->client->ps.damageEvent++;
ent->client->ps.damageCount += damage;
if (ent->client->lasthurt_mod != 0) {
//Blaze: Print out some debug info
if (&g_entities[ent->client->lasthurt_client] == NULL) G_Printf("Ln 0779\n");
G_Damage(ent, &g_entities[ent->client->lasthurt_client],
&g_entities[ent->client->lasthurt_client], NULL, NULL, damage, 0, MOD_FALLING);
} else {

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.9 2002/09/24 05:06:16 blaze
// fixed spectating so ref\'s can now use all the chasecam modes.
//
// Revision 1.8 2002/06/16 20:06:14 jbravo
// Reindented all the source files with "indent -kr -ut -i8 -l120 -lc120 -sob -bad -bap"
//
@ -49,6 +52,9 @@ void UpdateTournamentInfo(void)
// find the real player
player = NULL;
for (i = 0; i < level.maxclients; i++) {
//Blaze: Print out some debug info
if (&g_entities[i] == NULL) G_Printf("Ln 0052\n");
player = &g_entities[i];
if (!player->inuse) {
continue;

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.116 2002/09/24 05:06:16 blaze
// fixed spectating so ref\'s can now use all the chasecam modes.
//
// Revision 1.115 2002/09/02 03:30:53 jbravo
// Hopefully fixed the skinhacking
//
@ -383,6 +386,8 @@ qboolean SpotWouldTelefrag(gentity_t * spot)
num = trap_EntitiesInBox(mins, maxs, touch, MAX_GENTITIES);
for (i = 0; i < num; i++) {
//Blaze: Print out some Debug info
if (&g_entities[touch[i]] == NULL) G_Printf("Ln 0376\n");
hit = &g_entities[touch[i]];
//if ( hit->client && hit->client->ps.stats[STAT_HEALTH] > 0 ) {
if (hit->client) {
@ -1338,7 +1343,8 @@ char *ClientConnect(int clientNum, qboolean firstTime, qboolean isBot)
gclient_t *client;
char userinfo[MAX_INFO_STRING], ipaddr[64];
gentity_t *ent;
//Blaze: Prit out some Debug info
if (&g_entities[clientNum] == NULL) G_Printf("Ln 1399\n");
ent = &g_entities[clientNum];
trap_GetUserinfo(clientNum, userinfo, sizeof(userinfo));
@ -1985,6 +1991,9 @@ void ClientDisconnect(int clientNum)
if (level.clients[i].sess.sessionTeam == TEAM_SPECTATOR
&& level.clients[i].sess.spectatorState == SPECTATOR_FOLLOW
&& level.clients[i].sess.spectatorClient == clientNum) {
//Blaze: Prit out some Debug info
if (&g_entities[i] == NULL) G_Printf("Ln 2049\n");
StopFollowing(&g_entities[i]);
}
}

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.168 2002/09/24 05:06:17 blaze
// fixed spectating so ref\'s can now use all the chasecam modes.
//
// Revision 1.167 2002/09/07 22:40:01 jbravo
// Added a scaling ctb respawn system. Fixed a bug that allowed players to
// spawn before their team respawn with the team command.
@ -468,6 +471,8 @@ void DeathmatchScoreboardMessage(gentity_t * ent)
ent->client->sess.savedTeam != cl->sess.savedTeam)
alive = qtrue;
}
//Blaze: Prit out some Debug info
if (&g_entities[level.sortedClients[i]] == NULL) G_Printf("Ln 1399\n");
Com_sprintf(entry, sizeof(entry), " %i %i %i %i %i %i %i %i %i %i %i %i",
level.sortedClients[i],
@ -1326,7 +1331,8 @@ void Cmd_FollowCycle_f(gentity_t * ent, int dir)
}
// JBravo: limchasecam
if (g_gametype.integer == GT_TEAMPLAY && g_RQ3_limchasecam.integer != 0 &&
ent->client->sess.savedTeam != level.clients[clientnum].sess.sessionTeam) {
ent->client->sess.savedTeam != level.clients[clientnum].sess.sessionTeam && ent->client->sess.referee == 0) {
G_Printf("SavedTeam = (%d)\n",ent->client->sess.savedTeam);
continue;
}
// this is good, we can use it
@ -1515,6 +1521,9 @@ void G_Say(gentity_t * ent, gentity_t * target, int mode, const char *chatText)
// send it to all the apropriate clients
for (j = 0; j < level.maxclients; j++) {
//Blaze: Prit out some Debug info
if (&g_entities[j] == NULL) G_Printf("Ln 1532\n");
other = &g_entities[j];
G_SayTo(ent, other, mode, color, name, text);
}
@ -1585,6 +1594,8 @@ static void Cmd_Tell_f(gentity_t * ent)
if (targetNum < 0 || targetNum >= level.maxclients) {
return;
}
//Blaze: Prit out some Debug info
if (&g_entities[targetNum] == NULL) G_Printf("Ln 1608\n");
target = &g_entities[targetNum];
if (!target || !target->inuse || !target->client) {
@ -1657,6 +1668,9 @@ void G_Voice(gentity_t * ent, gentity_t * target, int mode, const char *id, qboo
}
// send it to all the apropriate clients
for (j = 0; j < level.maxclients; j++) {
//Blaze: Prit out some Debug info
if (&g_entities[j] == NULL) G_Printf("Ln 1682\n");
other = &g_entities[j];
G_VoiceTo(ent, other, mode, id, voiceonly);
}
@ -1705,6 +1719,8 @@ static void Cmd_VoiceTell_f(gentity_t * ent, qboolean voiceonly)
if (targetNum < 0 || targetNum >= level.maxclients) {
return;
}
//Blaze: Prit out some Debug info
if (&g_entities[targetNum] == NULL) G_Printf("Ln 1733\n");
target = &g_entities[targetNum];
if (!target || !target->inuse || !target->client) {
@ -1824,6 +1840,9 @@ void Cmd_GameCommand_f(gentity_t * ent)
if (order < 0 || order > sizeof(gc_orders) / sizeof(char *)) {
return;
}
//Blaze: Prit out some Debug info
if (&g_entities[player] == NULL) G_Printf("Ln 1854\n");
G_Say(ent, &g_entities[player], SAY_TELL, gc_orders[order]);
G_Say(ent, ent, SAY_TELL, gc_orders[order]);
}

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.126 2002/09/24 05:06:17 blaze
// fixed spectating so ref\'s can now use all the chasecam modes.
//
// Revision 1.125 2002/09/02 02:21:13 niceass
// removed spherical head detection
//
@ -696,6 +699,9 @@ void SendObit(char *msg, gentity_t * deadguy, gentity_t * attacker)
} else {
if (g_RQ3_showOwnKills.integer == 0) {
for (i = 0; i < level.maxclients; i++) {
//Blaze: Prit out some Debug info
if (&g_entities[i] == NULL) G_Printf("Ln 0693\n");
other = &g_entities[i];
if (!other->inuse || !other->client)
continue;
@ -706,6 +712,9 @@ void SendObit(char *msg, gentity_t * deadguy, gentity_t * attacker)
}
} else {
for (i = 0; i < level.maxclients; i++) {
//Blaze: Prit out some Debug info
if (&g_entities[i] == NULL) G_Printf("Ln 1399\n");
other = &g_entities[i];
if (!other->inuse || !other->client)
continue;
@ -2424,6 +2433,9 @@ qboolean G_RadiusDamage(vec3_t origin, gentity_t * attacker, float damage, float
numListedEntities = trap_EntitiesInBox(mins, maxs, entityList, MAX_GENTITIES);
for (e = 0; e < numListedEntities; e++) {
//Blaze: Prit out some Debug info
if (&g_entities[entityList[e]] == NULL) G_Printf("Ln 2499\n");
ent = &g_entities[entityList[e]];
if (ent == ignore)

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.119 2002/09/24 05:06:17 blaze
// fixed spectating so ref\'s can now use all the chasecam modes.
//
// Revision 1.118 2002/09/10 14:14:20 makro
// no message
//
@ -1018,6 +1021,9 @@ void G_InitGame(int levelTime, int randomSeed, int restart)
// set client fields on player ents
for (i = 0; i < level.maxclients; i++) {
//Blaze: Prit out some Debug info
if (&g_entities[i] == NULL) G_Printf("Ln 0994\n");
g_entities[i].client = level.clients + i;
}
@ -1234,6 +1240,10 @@ void AddTournamentPlayer(void)
level.warmupTime = -1;
//Blaze: Prit out some Debug info
if (&g_entities[nextInLine - level.clients] == NULL) G_Printf("Ln 1214\n");
// set them to free-for-all team
SetTeam(&g_entities[nextInLine - level.clients], "f");
}
@ -1258,6 +1268,10 @@ void RemoveTournamentLoser(void)
if (level.clients[clientNum].pers.connected != CON_CONNECTED) {
return;
}
//Blaze: Prit out some Debug info
if (&g_entities[clientNum] == NULL) G_Printf("Ln 1241\n");
// make them a spectator
SetTeam(&g_entities[clientNum], "s");
}
@ -1280,6 +1294,9 @@ void RemoveTournamentWinner(void)
if (level.clients[clientNum].pers.connected != CON_CONNECTED) {
return;
}
//Blaze: Prit out some Debug info
if (&g_entities[clientNum] == NULL) G_Printf("Ln 1241\n");
// make them a spectator
SetTeam(&g_entities[clientNum], "s");
}
@ -1396,6 +1413,8 @@ void CalculateRanks(void)
if (g_gametype.integer >= GT_TEAM) {
if (level.clients[i].pers.connected == CON_CONNECTED) {
level.numPlayingClients++;
//Blaze: Prit out some Debug info
if (&g_entities[i] == NULL) G_Printf("Ln 1386\n");
if (!(g_entities[i].r.svFlags & SVF_BOT)) {
level.numVotingClients++;
}
@ -1412,6 +1431,8 @@ void CalculateRanks(void)
// decide if this should be auto-followed
if (level.clients[i].pers.connected == CON_CONNECTED) {
level.numPlayingClients++;
//Blaze: Prit out some Debug info
if (&g_entities[i] == NULL) G_Printf("Ln 1241\n");
if (!(g_entities[i].r.svFlags & SVF_BOT)) {
level.numVotingClients++;
if (level.clients[i].sess.sessionTeam == TEAM_RED)
@ -1809,7 +1830,9 @@ void LogExit(const char *string)
G_LogPrintf("score: %i ping: %i client: %i %s\n", cl->ps.persistant[PERS_SCORE], ping,
level.sortedClients[i], cl->pers.netname);
//Blaze: Prit out some Debug info
if (&g_entities[cl - level.clients] == NULL) G_Printf("Ln 1792\n");
// Don't print bot statistics
if (g_RQ3_statLog.integer && !(g_entities[cl - level.clients].r.svFlags & SVF_BOT)) {
// Elder: Statistics tracking for server
@ -1936,6 +1959,9 @@ void CheckIntermissionExit(void)
if (cl->pers.connected != CON_CONNECTED) {
continue;
}
//Blaze: Prit out some Debug info
if (&g_entities[cl->ps.clientNum] == NULL) G_Printf("Ln 1925\n");
if (g_entities[cl->ps.clientNum].r.svFlags & SVF_BOT) {
continue;
}
@ -2341,6 +2367,8 @@ void CheckTeamLeader(int team)
for (i = 0; i < level.maxclients; i++) {
if (level.clients[i].sess.sessionTeam != team)
continue;
//Blaze: Prit out some Debug info
if (&g_entities[i] == NULL) G_Printf("Ln 2333\n");
if (!(g_entities[i].r.svFlags & SVF_BOT)) {
level.clients[i].sess.teamLeader = qtrue;
break;

View file

@ -26,6 +26,8 @@ int getNumberOfRefs() {
int i,count;
count = 0;
for (i = 0; i < level.maxclients; i++) {
//Blaze: Prit out some Debug info
if (&g_entities[i] == NULL) G_Printf("Ln 0030\n");
ent = &g_entities[i];
if (!ent->inuse)
continue;
@ -41,6 +43,8 @@ gentity_t *getEntByName(char *name)
int i;
for (i = 0; i < level.maxclients; i++) {
//Blaze: Prit out some Debug info
if (&g_entities[i] == NULL) G_Printf("Ln 0047\n");
ent = &g_entities[i];
if (!ent->inuse)
continue;
@ -56,6 +60,8 @@ qboolean checkCaptain(team_t team)
int i;
for (i = 0; i < level.maxclients; i++) {
//Blaze: Prit out some Debug info
if (&g_entities[i] == NULL) G_Printf("Ln 0059\n");
ent = &g_entities[i];
if (!ent->inuse)
continue;
@ -377,6 +383,8 @@ void MM_ClearScores(qboolean clearTeamFlags)
int i;
for (i = 0; i < level.maxclients; i++) {
//Blaze: Prit out some Debug info
if (&g_entities[i] == NULL) G_Printf("Ln 1241\n");
ent = &g_entities[i];
if (!ent->inuse)
continue;

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.138 2002/09/24 05:06:17 blaze
// fixed spectating so ref\'s can now use all the chasecam modes.
//
// Revision 1.137 2002/09/09 02:26:55 niceass
// enabled drop case
//
@ -993,7 +996,7 @@ void SpawnPlayers()
client->sess.teamSpawn = qfalse;
}
// JBravo: lets make those pesky subs follow live players.
if (g_RQ3_limchasecam.integer != 0 && g_RQ3_matchmode.integer) {
if (g_RQ3_limchasecam.integer != 0 && g_RQ3_matchmode.integer ) {
for (i = 0; i < level.maxclients; i++) {
player = &g_entities[i];
if (!player->inuse || !player->client)
@ -1397,7 +1400,7 @@ void MakeSpectator(gentity_t * ent)
}
if (ent->r.svFlags & SVF_BOT)
client->sess.spectatorState = SPECTATOR_FREE;
else if (g_RQ3_limchasecam.integer != 0) {
else if (g_RQ3_limchasecam.integer != 0 ) {
if (OKtoFollow(ent - g_entities)) {
client->sess.spectatorState = SPECTATOR_FOLLOW;
client->specMode = SPECTATOR_FOLLOW;
@ -1439,12 +1442,17 @@ qboolean OKtoFollow(int clientnum)
if (level.clients[i].sess.sessionTeam == TEAM_SPECTATOR) {
continue;
}
if (level.clients[clientnum].sess.referee == 1 && level.clients[clientnum].sess.savedTeam == TEAM_SPECTATOR) {
x++;
}
if (g_gametype.integer == GT_TEAMPLAY && g_RQ3_limchasecam.integer != 0 &&
level.clients[i].sess.sessionTeam != level.clients[clientnum].sess.savedTeam) {
continue;
}
x++;
};
if (x > 0) {
return qtrue;
}

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.82 2002/09/24 05:06:17 blaze
// fixed spectating so ref\'s can now use all the chasecam modes.
//
// Revision 1.81 2002/09/08 03:31:36 niceass
// accuracy improved
//
@ -1766,7 +1769,6 @@ void CalcMuzzlePoint(gentity_t * ent, vec3_t forward, vec3_t right, vec3_t up, v
muzzlePoint[2] += ent->client->ps.viewheight;
VectorMA(muzzlePoint, 14, forward, muzzlePoint);
// snap to integer coordinates for more efficient network bandwidth usage
// SnapVector(muzzlePoint);
}
/*
@ -1783,7 +1785,6 @@ void CalcMuzzlePointOrigin(gentity_t * ent, vec3_t origin, vec3_t forward, vec3_
muzzlePoint[2] += ent->client->ps.viewheight;
VectorMA(muzzlePoint, 14, forward, muzzlePoint);
// snap to integer coordinates for more efficient network bandwidth usage
// SnapVector(muzzlePoint);
}
/*