From 208a995d023ae9828820329cba0ca91543c77f28 Mon Sep 17 00:00:00 2001 From: Fesiug Date: Mon, 13 Nov 2023 19:28:18 -0500 Subject: [PATCH] Improvements to Deploy & Holster --- gamemodes/benny/entities/weapons/benny/sh_inv.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gamemodes/benny/entities/weapons/benny/sh_inv.lua b/gamemodes/benny/entities/weapons/benny/sh_inv.lua index cd9ccbf..83dd21d 100644 --- a/gamemodes/benny/entities/weapons/benny/sh_inv.lua +++ b/gamemodes/benny/entities/weapons/benny/sh_inv.lua @@ -27,6 +27,11 @@ function SWEP:DSetWepClip( hand, value ) end function SWEP:BDeploy( hand, id ) + if self:DGetWep( hand ) == id then + return -- PROTO: If you're in the middle of holstering, cancel it + elseif self:DGetWep( hand ) != "" then + self:BHolster( hand ) + end local p = self:GetOwner() local inv = p:INV_Get() @@ -45,10 +50,15 @@ function SWEP:BDeploy( hand, id ) end self:DSetClip( hand, item.Loaded == 0 and 0 or item[ "Ammo" .. item.Loaded ] ) + else + self:DSetClip( hand, 0 ) end end function SWEP:BHolster( hand ) + if self:DGetWep( hand ) == "" then + return -- What the hell are you holstering..? + end local p = self:GetOwner() local inv = p:INV_Get()