Now the scoreboard doesnt show whos alive and whos not when you are alive

This commit is contained in:
Richard Allen 2002-06-20 02:27:30 +00:00
parent 7edff87702
commit 15e746d625
3 changed files with 63 additions and 73 deletions

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.36 2002/06/20 02:27:30 jbravo
// Now the scoreboard doesnt show whos alive and whos not when you are alive
//
// Revision 1.35 2002/06/19 05:21:20 niceass // Revision 1.35 2002/06/19 05:21:20 niceass
// scoreboard stuff // scoreboard stuff
// //
@ -205,7 +208,7 @@ static void CG_DrawTeamplayClientScore(int y, score_t * score, float *Fill, floa
FillColor[3] = 1; FillColor[3] = 1;
// Dead? // Dead?
if (!score->alive) { // && cg.snap->ps.persistant[PERS_TEAM] == TEAM_SPECTATOR) { if (!score->alive && cg.snap->ps.persistant[PERS_TEAM] == TEAM_SPECTATOR) {
TextColor[0] *= 0.5f; TextColor[0] *= 0.5f;
TextColor[1] *= 0.5f; TextColor[1] *= 0.5f;
TextColor[2] *= 0.5f; TextColor[2] *= 0.5f;

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.135 2002/06/20 02:27:30 jbravo
// Now the scoreboard doesnt show whos alive and whos not when you are alive
//
// Revision 1.134 2002/06/19 18:18:09 jbravo // Revision 1.134 2002/06/19 18:18:09 jbravo
// Small cleanups for compiler warnings // Small cleanups for compiler warnings
// //

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.110 2002/06/20 02:27:30 jbravo
// Now the scoreboard doesnt show whos alive and whos not when you are alive
//
// Revision 1.109 2002/06/19 18:13:57 jbravo // Revision 1.109 2002/06/19 18:13:57 jbravo
// New TNG spawning system :) // New TNG spawning system :)
// //
@ -1984,7 +1987,8 @@ void Add_TeamWound(gentity_t * attacker, gentity_t * victim, int mod)
return; return;
} else { } else {
trap_SendServerCommand(-1, trap_SendServerCommand(-1,
va("print \"Banning %s^7 for team wounding\n\"", attacker->client->pers.netname)); va("print \"Banning %s^7 for team wounding\n\"",
attacker->client->pers.netname));
trap_SendServerCommand(attacker - g_entities, trap_SendServerCommand(attacker - g_entities,
va va
("print \"You've wounded teammates too many times, and are banned for %d %s.\n\"", ("print \"You've wounded teammates too many times, and are banned for %d %s.\n\"",
@ -2158,7 +2162,8 @@ void RQ3_AddOrDelIgnoreSubject(gentity_t * source, gentity_t * subject, qboolean
va("print \"%s^7 was added to ignore list.\n\"", va("print \"%s^7 was added to ignore list.\n\"",
subject->client->pers.netname)); subject->client->pers.netname));
trap_SendServerCommand(subject - g_entities, trap_SendServerCommand(subject - g_entities,
va("print \"%s^7 ignores you.\n\"", source->client->pers.netname)); va("print \"%s^7 ignores you.\n\"",
source->client->pers.netname));
} }
} }
} }
@ -2309,10 +2314,10 @@ int QDECL RQ3_compare_spawn_distances (const void *sd1, const void *sd2)
// Freud: SpawnPointDistance // Freud: SpawnPointDistance
// //
// Returns the distance between two spawn points (or any entities, actually...) // Returns the distance between two spawn points (or any entities, actually...)
float float RQ3_SpawnPointDistance(gentity_t * spot1, gentity_t * spot2)
RQ3_SpawnPointDistance (gentity_t * spot1, gentity_t * spot2)
{ {
vec3_t v; vec3_t v;
VectorSubtract(spot1->s.origin, spot2->s.origin, v); VectorSubtract(spot1->s.origin, spot2->s.origin, v);
return VectorLength(v); return VectorLength(v);
} }
@ -2364,41 +2369,33 @@ qboolean RQ3_SelectRandomTeamplaySpawnPoint (int team)
ok = qfalse; ok = qfalse;
// Done with potential spawns, re-reading and re-assigning // Done with potential spawns, re-reading and re-assigning
if (level.num_potential_spawns[team] < 1) if (level.num_potential_spawns[team] < 1) {
{
RQ3_GetSpawnPoints(); RQ3_GetSpawnPoints();
RQ3_SetupTeamSpawnPoints(); RQ3_SetupTeamSpawnPoints();
return qfalse; return qfalse;
} }
// Randomizing from potential spawn points // Randomizing from potential spawn points
spawn_point = rand() % level.num_potential_spawns[team]; spawn_point = rand() % level.num_potential_spawns[team];
// decrementing potential spawns counter // decrementing potential spawns counter
level.num_potential_spawns[team]--; level.num_potential_spawns[team]--;
while ((ok == qfalse) && (i < MAX_TEAMS)) while ((ok == qfalse) && (i < MAX_TEAMS)) {
{
ok = qtrue; ok = qtrue;
for (y = 0; y < MAX_TEAMS; y++) for (y = 0; y < MAX_TEAMS; y++) {
{ if (level.teams_assigned[y] == qtrue) {
if (level.teams_assigned[y] == qtrue)
{
distance = RQ3_SpawnPointDistance(level.potential_spawns[team][spawn_point], distance = RQ3_SpawnPointDistance(level.potential_spawns[team][spawn_point],
level.teamplay_spawns[y]); level.teamplay_spawns[y]);
if (distance == 0) if (distance == 0) {
{
ok = qfalse; ok = qfalse;
} }
} }
} }
if (ok == qfalse) if (ok == qfalse) {
{
spawn_point++; spawn_point++;
if (spawn_point == level.num_potential_spawns[team]) if (spawn_point == level.num_potential_spawns[team]) {
{
spawn_point = 0; spawn_point = 0;
} }
i++; i++;
@ -2409,21 +2406,17 @@ qboolean RQ3_SelectRandomTeamplaySpawnPoint (int team)
level.teams_assigned[team] = qtrue; level.teams_assigned[team] = qtrue;
// Removing used spawn point from potential_spawns // Removing used spawn point from potential_spawns
for (z = spawn_point;z < level.num_potential_spawns[team];z++) for (z = spawn_point; z < level.num_potential_spawns[team]; z++) {
{
level.potential_spawns[team][z] = level.potential_spawns[team][z + 1]; level.potential_spawns[team][z] = level.potential_spawns[team][z + 1];
} }
if (i == MAX_TEAMS) if (i == MAX_TEAMS) {
{
G_Printf("Arrrggh: More teams than potential spawnpoints!\n"); G_Printf("Arrrggh: More teams than potential spawnpoints!\n");
if ((spot = G_Find (spot, FOFS (classname), "info_player_start")) != NULL) if ((spot = G_Find(spot, FOFS(classname), "info_player_start")) != NULL) {
{
G_Printf("Well, guess I'm using info_player_start\n"); G_Printf("Well, guess I'm using info_player_start\n");
level.teamplay_spawns[team] = spot; level.teamplay_spawns[team] = spot;
} } else
else
return qfalse; return qfalse;
} }
return qtrue; return qtrue;
@ -2452,18 +2445,15 @@ qboolean RQ3_SelectFarTeamplaySpawnPoint (int team)
} }
// //
for (x = 0; x < level.num_potential_spawns[team]; x++) for (x = 0; x < level.num_potential_spawns[team]; x++) {
{
closest_spawn_distance = 2000000000; closest_spawn_distance = 2000000000;
for (y = 0; y < MAX_TEAMS; y++) for (y = 0; y < MAX_TEAMS; y++) {
{ if (level.teams_assigned[y] == qtrue) {
if (level.teams_assigned[y] == qtrue) distance =
{ RQ3_SpawnPointDistance(level.potential_spawns[team][x], level.teamplay_spawns[y]);
distance = RQ3_SpawnPointDistance (level.potential_spawns[team][x], level.teamplay_spawns[y]);
if (distance < closest_spawn_distance) if (distance < closest_spawn_distance) {
{
closest_spawn_distance = distance; closest_spawn_distance = distance;
} }
} }
@ -2477,8 +2467,7 @@ qboolean RQ3_SelectFarTeamplaySpawnPoint (int team)
} }
// Sort the farthest spawn points to the end of the array // Sort the farthest spawn points to the end of the array
qsort (spawn_distances, MAX_SPAWN_POINTS, qsort(spawn_distances, MAX_SPAWN_POINTS, sizeof(spawn_distances_t), RQ3_compare_spawn_distances);
sizeof (spawn_distances_t), RQ3_compare_spawn_distances);
total_good_spawn_points = level.num_potential_spawns[team] - num_already_used; total_good_spawn_points = level.num_potential_spawns[team] - num_already_used;
@ -2493,30 +2482,25 @@ qboolean RQ3_SelectFarTeamplaySpawnPoint (int team)
num_usable = 0; num_usable = 0;
// Now lets go through the spawn points and see if they have been used up. // Now lets go through the spawn points and see if they have been used up.
for (z = 0;z < preferred_spawn_points;z++) for (z = 0; z < preferred_spawn_points; z++) {
{
used = qfalse; used = qfalse;
for (u = 0; u < level.num_used_farteamplay_spawns[team]; u++) for (u = 0; u < level.num_used_farteamplay_spawns[team]; u++) {
{
if (level.used_farteamplay_spawns[team][u] == spawn_distances[MAX_SPAWN_POINTS - z - 1].s) { if (level.used_farteamplay_spawns[team][u] == spawn_distances[MAX_SPAWN_POINTS - z - 1].s) {
used = qtrue; used = qtrue;
} }
} }
if (used == qfalse) if (used == qfalse) {
{
usable_spawns[num_usable] = spawn_distances[MAX_SPAWN_POINTS - z - 1].s; usable_spawns[num_usable] = spawn_distances[MAX_SPAWN_POINTS - z - 1].s;
num_usable++; num_usable++;
} }
} }
// Can't use any of the far spawn points, let's go through the whole thing again. // Can't use any of the far spawn points, let's go through the whole thing again.
if (num_usable < 1) if (num_usable < 1) {
{
RQ3_SetupTeamSpawnPoints(); RQ3_SetupTeamSpawnPoints();
return qfalse; return qfalse;
} }
// Randomize through the usable spawns. // Randomize through the usable spawns.
spawn_to_use = rand() % num_usable; spawn_to_use = rand() % num_usable;