Add weapon_bayonet to the list of blocked knives (#1758)

This commit is contained in:
TrueProfesional
2022-12-20 22:17:22 +00:00
committed by GitHub
parent f8349e846a
commit 174bf307a2
+1 -1
View File
@@ -166,7 +166,7 @@ static cell_t GiveNamedItem(IPluginContext *pContext, const cell_t *params)
// Don't allow knives other than weapon_knife, weapon_knifegg, and weapon_knife_t.
// Others follow pattern weapon_knife_*
size_t len = strlen(pWeaponName);
if (len >= 14 && strnicmp(pWeaponName, "weapon_knife_", 13) == 0 && !(pWeaponName[13] == 't' && pWeaponName[14] == '\0'))
if ((len >= 14 && strnicmp(pWeaponName, "weapon_knife_", 13) == 0 && !(pWeaponName[13] == 't' && pWeaponName[14] == '\0')) || (len == 14 && stricmp(pWeaponName, "weapon_bayonet") == 0))
{
return pContext->ThrowNativeError("Blocked giving of %s due to core.cfg option FollowCSGOServerGuidelines", pWeaponName);
}