From 6d5ed28bbf979f461a1b7dc301e05cf2b660de02 Mon Sep 17 00:00:00 2001 From: JetBoom Date: Fri, 21 Nov 2014 02:28:59 -0500 Subject: [PATCH] Fix medical aura persisting when it shouldn't. --- .../entities/weapons/weapon_zs_medicalkit.lua | 7 +++++++ .../zombiesurvival/entities/weapons/weapon_zs_medicgun.lua | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/gamemodes/zombiesurvival/entities/weapons/weapon_zs_medicalkit.lua b/gamemodes/zombiesurvival/entities/weapons/weapon_zs_medicalkit.lua index bb11d4c..2e1be8d 100644 --- a/gamemodes/zombiesurvival/entities/weapons/weapon_zs_medicalkit.lua +++ b/gamemodes/zombiesurvival/entities/weapons/weapon_zs_medicalkit.lua @@ -130,6 +130,13 @@ function SWEP:Holster() return true end +function SWEP:OnRemove() + if CLIENT and self.Owner == LocalPlayer() then + hook.Remove("PostPlayerDraw", "PostPlayerDrawMedical") + GAMEMODE.MedicalAura = false + end +end + function SWEP:Reload() end diff --git a/gamemodes/zombiesurvival/entities/weapons/weapon_zs_medicgun.lua b/gamemodes/zombiesurvival/entities/weapons/weapon_zs_medicgun.lua index 96c1f35..e3a908a 100644 --- a/gamemodes/zombiesurvival/entities/weapons/weapon_zs_medicgun.lua +++ b/gamemodes/zombiesurvival/entities/weapons/weapon_zs_medicgun.lua @@ -101,3 +101,10 @@ function SWEP:Holster() return true end + +function SWEP:OnRemove() + if CLIENT and self.Owner == LocalPlayer() then + hook.Remove("PostPlayerDraw", "PostPlayerDrawMedical") + GAMEMODE.MedicalAura = false + end +end