From 3b55686c7863ee07798a63f5cb51093994cb1513 Mon Sep 17 00:00:00 2001 From: Redox Date: Mon, 30 Dec 2024 04:17:41 +0100 Subject: [PATCH] Add cant fire state and reset lock on reload --- lua/weapons/glide_homing_launcher.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lua/weapons/glide_homing_launcher.lua b/lua/weapons/glide_homing_launcher.lua index acde32a..c6a5628 100644 --- a/lua/weapons/glide_homing_launcher.lua +++ b/lua/weapons/glide_homing_launcher.lua @@ -266,6 +266,7 @@ if CLIENT then local AIM_ICON = "glide/aim_square.png" local LOCKON_STATE_COLORS = { + [-1] = Color( 220, 220, 220, 100 ), [0] = Color( 255, 255, 255 ), [1] = Color( 255, 255, 255 ), [2] = Color( 100, 255, 100 ), @@ -346,6 +347,12 @@ function SWEP:UpdateTarget() local t = CurTime() + if not self:CanAttack() then + self:SetLockTarget( NULL ) + self:SetLockState( -1 ) + return + end + if not user:KeyDown( IN_ATTACK2 ) then self:SetLockTarget( NULL ) self:SetLockState( 0 )