Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ZMarketEquip): invalid client index error (#78) #79

Merged
merged 1 commit into from
Feb 18, 2025
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/addons/sourcemod/scripting/zr/hgversion.h.inc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#define ZR_VER_BRANCH "master"
#define ZR_VER_MAJOR "3"
#define ZR_VER_MINOR "11"
#define ZR_VER_PATCH "1"
#define ZR_VER_PATCH "2"
#define ZR_VERSION ZR_VER_MAJOR..."."...ZR_VER_MINOR..."."...ZR_VER_PATCH
#define ZR_VER_LICENSE "GNU GPL, Version 3"
#define ZR_VER_DATE "Wed Jan 30 09:38:56 CEST 2025"
6 changes: 6 additions & 0 deletions src/addons/sourcemod/scripting/zr/weapons/zmarket.inc
Original file line number Diff line number Diff line change
Expand Up @@ -984,6 +984,12 @@ void DelayedBuyRefund(DataPack hPack)
*/
stock bool ZMarketEquip(int client, const char[] weapon, bool rebuy = false)
{
// If client isn't in-game, then stop.
if (client <= 0 || client > MaxClients || !IsClientConnected(client) || !IsClientInGame(client))
{
return false;
}

// if zombie hasn't spawned yet we're always rebuying:
bool zmarketfreespawn = GetConVarBool(g_hCvarsList.CVAR_WEAPONS_ZMARKET_FREESPAWN);
if(zmarketfreespawn && !InfectHasZombieSpawned())
Expand Down
Loading