Skip to content
Merged
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
10 changes: 5 additions & 5 deletions addons/sourcemod/scripting/Status.sp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public Plugin myinfo =
name = "Status Fixer",
author = "zaCade + BotoX + Obus + .Rushaway",
description = "Fixes the \"status\" command",
version = "2.1.6",
version = "2.1.7",
url = "https://github.com/srcdslab/sm-plugin-Status"
};

Expand Down Expand Up @@ -173,10 +173,10 @@ public Action Command_Status(int client, const char[] command, int args)

if (!IsFakeClient(player))
{
float fTime = GetClientTime(player);
int iHours = RoundToFloor((fTime / 3600));
int iMinutes = RoundToFloor((fTime - (iHours * 3600)) / 60);
int iSeconds = RoundToFloor((fTime - (iHours * 3600)) - (iMinutes * 60));
int iTime = RoundToFloor(GetClientTime(player));
int iHours = iTime / 3600;
int iMinutes = (iTime - (iHours * 3600)) / 60;
int iSeconds = iTime - (iHours * 3600) - (iMinutes * 60);
Comment on lines 174 to +179
Copy link

Copilot AI Mar 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For fake clients this block is skipped, leaving sPlayerTime/sPlayerPing/sPlayerLoss uninitialized but still printed later in the row. This can produce garbage output (or stale values if the stack happens to contain previous data). Initialize these fields to sensible defaults before the if (!IsFakeClient(player)) or add an else branch that formats placeholders for bots.

Copilot uses AI. Check for mistakes.

if (iHours)
FormatEx(sPlayerTime, sizeof(sPlayerTime), "%d:%02d:%02d", iHours, iMinutes, iSeconds);
Expand Down