diff --git a/lua/arccw/client/cl_binds.lua b/lua/arccw/client/cl_binds.lua index 78270738..0ad1342a 100644 --- a/lua/arccw/client/cl_binds.lua +++ b/lua/arccw/client/cl_binds.lua @@ -12,6 +12,8 @@ ArcCW.KEY_TOGGLEUBGL = "arccw_toggle_ubgl" ArcCW.KEY_TOGGLEATT = "arccw_toggle_att" ArcCW.KEY_MELEE = "arccw_melee" +ArcCW.IN_MELEE = false + ArcCW.BindToEffect = { [ArcCW.KEY_FIREMODE] = "firemode", [ArcCW.KEY_ZOOMIN] = "zoomin", @@ -146,7 +148,9 @@ local function ArcCW_PlayerBindPress(ply, bind, pressed) end if bind == "melee" and wep:GetState() != ArcCW.STATE_SIGHTS then - wep:Bash() + ArcCW.IN_MELEE = true + timer.Simple(0, function() ArcCW.IN_MELEE = false end) + block = true end if block then return true end @@ -195,4 +199,11 @@ end -- end -- return false --- end \ No newline at end of file +-- end + +hook.Add("StartCommand", "ArcCW_StartCommand_Melee", function(ply, ucmd) + if ArcCW.IN_MELEE then + ucmd:AddKey(IN_BULLRUSH) + ucmd:AddKey(IN_ATTACK) + end +end) \ No newline at end of file diff --git a/lua/weapons/arccw_base/sh_firing.lua b/lua/weapons/arccw_base/sh_firing.lua index 3da24a40..2fc65c58 100644 --- a/lua/weapons/arccw_base/sh_firing.lua +++ b/lua/weapons/arccw_base/sh_firing.lua @@ -50,7 +50,7 @@ function SWEP:CanPrimaryAttack() if self:GetHeatLocked() then return end -- Attempting a bash - if self:GetState() != ArcCW.STATE_SIGHTS and owner:KeyDown(IN_USE) or self.PrimaryBash then self:Bash() return end + if self:GetState() != ArcCW.STATE_SIGHTS and (owner:KeyDown(IN_USE) or owner:KeyDown(IN_BULLRUSH)) or self.PrimaryBash then self:Bash() return end -- Throwing weapon if self.Throwing then self:PreThrow() return end