Skip to content

Fix show_expired change hook attached to the wrong convar - #26

Merged
Rushaway merged 2 commits into
masterfrom
fix/wrong-convar-changehook
Sep 21, 2026
Merged

Rushaway merged 2 commits into
masterfrom
fix/wrong-convar-changehook

Conversation

@Rushaway

Copy link
Copy Markdown
Member

Summary

  • hCvar.AddChangeHook(OnShowExpiredChange) attached the expired-display callback to the show_group convar instead of hCvar1 (show_expired).

Fixes #25

Test plan

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

🤖 Generated with Claude Code

hCvar.AddChangeHook(OnShowExpiredChange) attached the expired-display
callback to the show_group convar instead of hCvar1 (show_expired), so
changing vip_vo_show_expired at runtime never took effect and changing
vip_vo_show_group incorrectly also overwrote g_bShowExpired.

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:26

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

🟢 Approval recommended

The change is a minimal, correct fix for the reported hook miswiring, and no additional related issues were found in the surrounding convar hook usage.

Review effort: Lite
Findings: None

What changed in this PR

This pull request fixes a convar change-hook wiring bug in the SourceMod SourcePawn plugin so that runtime changes to vip_vo_show_expired correctly update the cached g_bShowExpired flag (aligning behavior with Issue #25).

Changes:

  • Attach OnShowExpiredChange to the correct convar instance (hCvar1 / vip_vo_show_expired) instead of hCvar (vip_vo_show_group).
File Description
addons/​sourcemod/​scripting/​VIP_VIPsOnline.sp Fixes the change hook target so vip_vo_show_expired updates g_bShowExpired correctly at runtime.

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

Updated plugin version and fixed minor convar issue.
@Rushaway
Rushaway merged commit 028a17a into master Sep 21, 2026
6 checks passed
@Rushaway
Rushaway deleted the fix/wrong-convar-changehook branch September 21, 2026 17:37
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.

vip_vo_show_expired change hook is wired to the wrong convar

2 participants