Skip to content

Commit

Permalink
fixed a bug with random skins and skin ids above 999 (thanks to @yrkn
Browse files Browse the repository at this point in the history
…for reporting)
  • Loading branch information
kgns committed Sep 22, 2021
1 parent 17ce754 commit de80af6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion addons/sourcemod/scripting/weapons/helpers.sp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ int GetRandomSkin(int client, int index)
{
int max = menuWeapons[g_iClientLanguage[client]][index].ItemCount;
int random = GetRandomInt(2, max);
char idStr[4];
char idStr[6];
menuWeapons[g_iClientLanguage[client]][index].GetItem(random, idStr, sizeof(idStr));
return StringToInt(idStr);
}
Expand Down Expand Up @@ -92,6 +92,7 @@ bool IsKnife(int entity)
return false;
}

/*
int DefIndexByClass(char[] class)
{
if (StrEqual(class, "weapon_knife"))
Expand All @@ -108,6 +109,7 @@ int DefIndexByClass(char[] class)
return index;
return 0;
}
*/

void RemoveWeaponPrefix(const char[] source, char[] output, int size)
{
Expand Down

0 comments on commit de80af6

Please sign in to comment.