The EV_NOAMMO handler in game/g_active.c (starting line 867) is dead code since it handles only grenades and WP_GRENADE is never selected to ent->s.weapon (except a little "monster hack" but it's reset immediately). WP_GRENADE is not a valid inventory item either, grenade has special UP_GRENADE item instead.
A quick way to check that code: Buy a grenade, switch to blaster and throw grenade. If that code wasn't dead, you'd switch to main weapon automatically after throwing grenade.
Created attachment 938 [details] Dead code patch This patch removes dead grenade code leaving empty EV_NOAMMO handler for further use.