Skip to content

Fix VIP tag never applying for players who already have a clan tag - #26

Closed
Rushaway wants to merge 1 commit into
masterfrom
fix/vip-tag-never-applied-with-existing-tag
Closed

Rushaway wants to merge 1 commit into
masterfrom
fix/vip-tag-never-applied-with-existing-tag

Conversation

@Rushaway

Copy link
Copy Markdown
Member

Summary

  • SetVipTag()'s early-return checked the saved original clan tag (used only by RestoreOriginalClanTag()) as if it gated whether to apply the VIP tag, making the feature a no-op for any player who already had a clan tag set.

Fixes #25

Test plan

  • Compiled cleanly via the local SourcePawn compiler, no errors/warnings.

🤖 Generated with Claude Code

The early return checked g_sOriginalClanTag[client], a snapshot used only
by RestoreOriginalClanTag() to undo the VIP tag later, as if it gated
whether the VIP tag should be applied. In practice this meant the VIP tag
feature only ever worked for players with no clan tag at connect time -
anyone already carrying one (e.g. from CountryTags/ClanTag/CustomChatColors)
got nothing when toggling the feature on, silently.

Fixes #25

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 20, 2026 09:28

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

With the early-return removed, the current OnClientSettingsChanged() logic can overwrite the saved “original” clan tag while the VIP tag is active, causing restores to revert to the VIP tag instead of the player’s real original tag.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

This PR fixes the VIP tag feature so it applies even when a player already has a clan tag set, aligning SetVipTag() behavior with the intended “apply configured VIP tag when enabled” logic described in issue #25.

Changes:

  • Removed the SetVipTag() early return that incorrectly prevented applying the VIP tag for players with an existing clan tag.
File Description
addons/​sourcemod/​scripting/​VIP_Tag.sp Removes the g_sOriginalClanTag guard so VIP clan tags are applied consistently when the feature is enabled.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 69 to 73
public void SetVipTag(int client)
{
if (g_sOriginalClanTag[client][0] != '\0')
return;

char sTag[64];
VIP_GetClientFeatureString(client, VIP_TAG, sTag, sizeof(sTag));
CS_SetClientClanTag(client, sTag);
@Rushaway

Copy link
Copy Markdown
Member Author

This is on purpose.

@Rushaway Rushaway closed this Sep 21, 2026
@Rushaway
Rushaway deleted the fix/vip-tag-never-applied-with-existing-tag branch September 21, 2026 17:38
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.

SetVipTag() silently no-ops for any player who already has a clan tag

2 participants