Skip to content

Commit

Permalink
Host_Status_f: Fixed incorrect player index to output
Browse files Browse the repository at this point in the history
  • Loading branch information
s1lentq committed Jan 25, 2024
1 parent 41c5186 commit 9b0dbe8
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions rehlds/engine/host_cmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,6 @@ void Host_Status_f(void)
Host_Status_Printf(conprint, log, "players : %i active (%i max)\n\n", nClients, g_psvs.maxclients);
Host_Status_Printf(conprint, log, "# name userid uniqueid frag time ping loss adr\n");

int count = 1;
client = g_psvs.clients;
for (j = 0; j < g_psvs.maxclients; j++, client++)
{
Expand All @@ -634,7 +633,7 @@ void Host_Status_f(void)
val = SV_GetClientIDString(client);
else val = "BOT";

Host_Status_Printf(conprint, log, "#%2i %8s %i %s", count++, va("\"%s\"", client->name), client->userid, val);
Host_Status_Printf(conprint, log, "#%2i %8s %i %s", j + 1, va("\"%s\"", client->name), client->userid, val);
if (client->proxy)
{
const char *userInfo = Info_ValueForKey(client->userinfo, "hspecs");
Expand Down Expand Up @@ -724,7 +723,6 @@ void Host_Status_Formatted_f(void)
Host_Status_Printf(conprint, log, "players : %i active (%i max)\n\n", nClients, g_psvs.maxclients);
Host_Status_Printf(conprint, log, "%-2.2s\t%-9.9s\t%-7.7s\t%-20.20s\t%-4.4s\t%-8.8s\t%-4.4s\t%-4.4s\t%-21.21s\n","# ","name","userid ","uniqueid ","frag","time ","ping","loss","adr");

int count = 1;
char *szRemoteAddr;
client = g_psvs.clients;
for (j = 0; j < g_psvs.maxclients; j++, client++)
Expand Down Expand Up @@ -755,7 +753,7 @@ void Host_Status_Formatted_f(void)
#endif // REHLDS_FIXES
szIDString = SV_GetClientIDString(client);
Host_Status_Printf(conprint, log, "%-2.2s\t%-9.9s\t%-7.7s\t%-20.20s\t%-4.4s\t%-8.8s\t%-4.4s\t%-4.4s\t%-21.21s\n",
va("%-2i", count++),va("\"%s\"", client->name),va("%-7i", client->userid),szIDString,
va("%-2i", j + 1),va("\"%s\"", client->name),va("%-7i", client->userid),szIDString,
va("%-4i", (int)client->edict->v.frags),sz,va("%-4i", SV_CalcPing(client)),va("%-4i", (int)client->packet_loss),szRemoteAddr);
}
Host_Status_Printf(conprint, log, "%i users\n", nClients);
Expand Down

0 comments on commit 9b0dbe8

Please sign in to comment.