forked from HaodongMo/ArcCW
Compare commits
1 Commits
master
...
fix-melee-
Author | SHA1 | Date | |
---|---|---|---|
![]() |
8a254b9ae8 |
@ -12,6 +12,8 @@ ArcCW.KEY_TOGGLEUBGL = "arccw_toggle_ubgl"
|
|||||||
ArcCW.KEY_TOGGLEATT = "arccw_toggle_att"
|
ArcCW.KEY_TOGGLEATT = "arccw_toggle_att"
|
||||||
ArcCW.KEY_MELEE = "arccw_melee"
|
ArcCW.KEY_MELEE = "arccw_melee"
|
||||||
|
|
||||||
|
ArcCW.IN_MELEE = false
|
||||||
|
|
||||||
ArcCW.BindToEffect = {
|
ArcCW.BindToEffect = {
|
||||||
[ArcCW.KEY_FIREMODE] = "firemode",
|
[ArcCW.KEY_FIREMODE] = "firemode",
|
||||||
[ArcCW.KEY_ZOOMIN] = "zoomin",
|
[ArcCW.KEY_ZOOMIN] = "zoomin",
|
||||||
@ -146,7 +148,9 @@ local function ArcCW_PlayerBindPress(ply, bind, pressed)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if bind == "melee" and wep:GetState() != ArcCW.STATE_SIGHTS then
|
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
|
end
|
||||||
|
|
||||||
if block then return true end
|
if block then return true end
|
||||||
@ -195,4 +199,11 @@ end
|
|||||||
-- end
|
-- end
|
||||||
|
|
||||||
-- return false
|
-- return false
|
||||||
-- end
|
-- 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)
|
@ -50,7 +50,7 @@ function SWEP:CanPrimaryAttack()
|
|||||||
if self:GetHeatLocked() then return end
|
if self:GetHeatLocked() then return end
|
||||||
|
|
||||||
-- Attempting a bash
|
-- 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
|
-- Throwing weapon
|
||||||
if self.Throwing then self:PreThrow() return end
|
if self.Throwing then self:PreThrow() return end
|
||||||
|
Loading…
Reference in New Issue
Block a user