From e76a9400f7d329b51d01d6a847ff327b3eb510dc Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 5 Oct 2026 19:02:45 +0000 Subject: [PATCH] fix: skip VIP checks for clients not in game on disconnect OnClientDisconnect also fires for clients that drop before entering the game. VIP Core natives throw "Client X is not connected" for those, so bail out early unless the client is in game. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01V2Q4N9D2yxJ52SzU4SsRns --- .github/copilot-instructions.md | 2 +- addons/sourcemod/scripting/VIP_FreeVIPGiveaway.sp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 11d4215..5f4f968 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -242,7 +242,7 @@ db.Query(CallbackFunction, query, clientId); ## Version Management -- Use semantic versioning in plugin info (currently 2.1) +- Use semantic versioning in plugin info (currently 2.1.1) - Update version in both plugin header and git tags - CI automatically creates releases from tags - Keep changelog for significant changes diff --git a/addons/sourcemod/scripting/VIP_FreeVIPGiveaway.sp b/addons/sourcemod/scripting/VIP_FreeVIPGiveaway.sp index 6a47988..5ed4951 100644 --- a/addons/sourcemod/scripting/VIP_FreeVIPGiveaway.sp +++ b/addons/sourcemod/scripting/VIP_FreeVIPGiveaway.sp @@ -32,7 +32,7 @@ public Plugin myinfo = name = "[VIP] Free VIP Giveaway", author = "inGame, maxime1907, Dolly", description = "Gives Free VIP for players that are active on server", - version = "2.1" + version = "2.1.1" }; public void OnPluginStart() @@ -266,7 +266,8 @@ void SetVIP(int client) public void OnClientDisconnect(int client) { - if(IsClientSourceTV(client) || IsFakeClient(client)) + // VIP Core natives throw on clients that never fully entered the game + if(!IsClientInGame(client) || IsClientSourceTV(client) || IsFakeClient(client)) return; char testVipGroup[16];