Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion source/client/defs/custom.qc
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ var struct revive_s {
float draw;
float timer;
float state;
} revive_icons[4]; // MAX_CLIENTS
} revive_icons[8]; // MAX_CLIENTS

float weaponframetime;
float weapon2frametime;
Expand Down
18 changes: 11 additions & 7 deletions source/client/hud.qc
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ void() HUD_Points =
float backwidth = 0.8*g_width;
vector TEXTCOLOR = '0 0 0';

for (int i = 3; i >= 0; i = i - 1)
for (int i = 7; i >= 0; i = i - 1)
{
float player_number = getplayerkeyfloat(i, "client_index");
entity client = findfloat(world, playernum, player_number);
Expand Down Expand Up @@ -1654,7 +1654,7 @@ void() HUD_Scores =
Draw_String([g_width/2 + (header_x_pos - getTextWidth("Headshots", scoreboard_text_size)/2), 180], "Headshots", [scoreboard_text_size, scoreboard_text_size], TEXTCOLOR, 1, 0);
header_x_pos += header_x_increment;

for (int i = 0; i < 4; i = i + 1)
for (int i = 0; i < 8; i = i + 1)
{
float player_number = getplayerkeyfloat(i, "client_index");
entity client = findfloat(world, playernum, player_number);
Expand Down Expand Up @@ -1994,7 +1994,7 @@ void() HUD_Spectator =

void() HUD_PlayerNames =
{
for (float i = 3; i >= 0; i = i - 1) {
for (float i = 7; i >= 0; i = i - 1) {
float player_number = getplayerkeyfloat(i, "client_index");

if (player_number == getstatf(STAT_PLAYERNUM))
Expand Down Expand Up @@ -2027,6 +2027,10 @@ void() HUD_PlayerNames =
case 1: text_color = TEXT_LIGHTBLUE; break;
case 2: text_color = TEXT_ORANGE; break;
case 3: text_color = TEXT_GREEN; break;
case 4: break;
case 5: text_color = TEXT_RED; break;
case 6: text_color = TEXT_YELLOW; break;
case 7: text_color = TEXT_PURPLE; break;
default: break;
}

Expand All @@ -2038,11 +2042,13 @@ void() HUD_PlayerNames =

void() HUD_ReviveIcons =
{
for (float i = 3; i >= 0; i = i - 1) {
for (float i = 7; i >= 0; i = i - 1) {
float player_index = i;

float player_number = getplayerkeyfloat(i, "client_index");

// Don't render our own Icon.
if (player_index + 1 == getstatf(STAT_PLAYERNUM))
if (player_number == getstatf(STAT_PLAYERNUM))
continue;

// Player is not in Last Stand.
Expand All @@ -2053,8 +2059,6 @@ void() HUD_ReviveIcons =
// Revive Icon should grow more and more red over time.
if (revive_icons[player_index].state == 1)
revive_icons[player_index].timer += frametime;

float player_number = getplayerkeyfloat(i, "client_index");

//string text = getplayerkeyvalue(i, "name");
entity client = findfloat(world, playernum, player_number);
Expand Down
3 changes: 3 additions & 0 deletions source/client/main.qc
Original file line number Diff line number Diff line change
Expand Up @@ -1129,6 +1129,9 @@ noref void() CSQC_Parse_Event =
break;
case EVENT_REVIVECHANGE:
float revivechange_player_index = readbyte() - 1; // playernum starts at one.
if (revivechange_player_index < 0)
return;

float state = readbyte();
revive_icons[revivechange_player_index].state = state;
break;
Expand Down