Although you do not use this function in your code, I would advise highly against ever using this method to switch a players weapon, i've personally seen bugs where the weapon u switch too can't be seen in your hands nor does the clients hud that shows your items properly update...say after using a molotov and forcefully changing to a primary or secondary the icon for the molotov stays in your inventory even though u no longer can select it or have it...instead use clientcommand/fakeclientcommand to set the weapon bug free by changing to its slot.
Last edited by MasterMind420; 01-19-2020 at 11:07.
Noticed a bug when scavenge items cvar is enable, if you press E next to a scavenge gascan it spawns another one next to it, but in the red color.
After messing with the code a bit I figured out that when pressing "E", sometimes it fires "GetItemOnFloor" for the "weapon_scavenge_item_spawn" entities [invisible], instead of the "weapon_gascan" and it makes another gascan spawn.
So to fix it I added another check on "IsValidItemPickup"
Here is the code in case the author wants to incorporate into the plugin, or someone else has the same problem. Seems to fix this bug.