Skip to content

feat(logic) keep optimize time calculation#30

Merged
Rushaway merged 1 commit intomasterfrom
Rushaway-patch-2
Mar 5, 2026
Merged

feat(logic) keep optimize time calculation#30
Rushaway merged 1 commit intomasterfrom
Rushaway-patch-2

Conversation

@Rushaway
Copy link
Member

@Rushaway Rushaway commented Mar 5, 2026

No description provided.

Copilot AI review requested due to automatic review settings March 5, 2026 16:14
@Rushaway Rushaway merged commit 4c23305 into master Mar 5, 2026
4 checks passed
@Rushaway Rushaway deleted the Rushaway-patch-2 branch March 5, 2026 16:15
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Status Fixer SourceMod plugin to optimize the player “connected time” calculation in the enhanced status output and bumps the plugin version accordingly.

Changes:

  • Bump plugin version from 2.1.6 to 2.1.7.
  • Optimize connected-time formatting by flooring client time once and performing integer hour/minute/second math.

Comment on lines 174 to +179
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);
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants