From a598e9c32721463f82345a6d1ae309faac54de2b Mon Sep 17 00:00:00 2001 From: AlmTech Date: Wed, 4 Sep 2019 21:26:32 +0200 Subject: [PATCH] Bug fix with near death effects --- gamemode/core/client/cl_hud.lua | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/gamemode/core/client/cl_hud.lua b/gamemode/core/client/cl_hud.lua index 806c62e..2a13d46 100644 --- a/gamemode/core/client/cl_hud.lua +++ b/gamemode/core/client/cl_hud.lua @@ -49,16 +49,18 @@ function GM:HUDPaint() end hook.Add( "RenderScreenspaceEffects", "Quantum_HUD_RenderLowHealth", function() - DrawColorModify( { - [ "$pp_colour_addr" ] = 0, - [ "$pp_colour_addg" ] = 0, - [ "$pp_colour_addb" ] = 0, - [ "$pp_colour_brightness" ] = Lerp( LocalPlayer():Health() / LocalPlayer():GetMaxHealth(), -0.75, 0 ), - [ "$pp_colour_contrast" ] = Lerp( LocalPlayer():Health() / LocalPlayer():GetMaxHealth(), 0.6, 1 ), - [ "$pp_colour_colour" ] = Lerp( LocalPlayer():Health() / LocalPlayer():GetMaxHealth(), 0.2, 1 ), - [ "$pp_colour_mulr" ] = 0, - [ "$pp_colour_mulg" ] = 0, - [ "$pp_colour_mulb" ] = 0 - } ) - if( LocalPlayer():Health() / LocalPlayer():GetMaxHealth() <= 0.15 ) then DrawMotionBlur( 0.4, 0.8, 0.1 ) end + if( LocalPlayer():Health() / LocalPlayer():GetMaxHealth() <= 0.15 ) then + DrawMotionBlur( 0.4, 0.8, 0.1 ) + DrawColorModify( { + [ "$pp_colour_addr" ] = 0, + [ "$pp_colour_addg" ] = 0, + [ "$pp_colour_addb" ] = 0, + [ "$pp_colour_brightness" ] = Lerp( LocalPlayer():Health() / LocalPlayer():GetMaxHealth(), -0.75, 0 ), + [ "$pp_colour_contrast" ] = Lerp( LocalPlayer():Health() / LocalPlayer():GetMaxHealth(), 0.6, 1 ), + [ "$pp_colour_colour" ] = Lerp( LocalPlayer():Health() / LocalPlayer():GetMaxHealth(), 0.2, 1 ), + [ "$pp_colour_mulr" ] = 0, + [ "$pp_colour_mulg" ] = 0, + [ "$pp_colour_mulb" ] = 0 + } ) + end end)