mirror of
https://github.com/JonnyBro/beatrun.git
synced 2024-12-29 21:33:02 +05:00
Fix goofy low health overlay stuff
This commit is contained in:
parent
4da9bae84e
commit
b2b8954d12
1 changed files with 3 additions and 2 deletions
|
@ -159,7 +159,7 @@ if CLIENT then
|
||||||
local dmgalpha = 0
|
local dmgalpha = 0
|
||||||
|
|
||||||
hook.Add("PreDrawHUD", "NTScreenEffects", function()
|
hook.Add("PreDrawHUD", "NTScreenEffects", function()
|
||||||
-- Not doing it this way breaks HUDs. And that's not cool.
|
-- Draw the overlay this way or we (sort of) break other HUDs.
|
||||||
cam.Start2D()
|
cam.Start2D()
|
||||||
local ply = LocalPlayer()
|
local ply = LocalPlayer()
|
||||||
|
|
||||||
|
@ -168,7 +168,8 @@ if CLIENT then
|
||||||
local w = ScrW()
|
local w = ScrW()
|
||||||
local h = ScrH()
|
local h = ScrH()
|
||||||
|
|
||||||
dmgalpha = math.min(300 * math.abs(ply:Health() / ply:GetMaxHealth() - 1), 255)
|
curhealth = math.Clamp(ply:Health(), 0, ply:GetMaxHealth())
|
||||||
|
dmgalpha = math.min(300 * math.abs(curhealth / ply:GetMaxHealth() - 1), 255)
|
||||||
|
|
||||||
surface.SetMaterial(radial)
|
surface.SetMaterial(radial)
|
||||||
surface.SetDrawColor(0, 0, 0, dmgalpha * 0.58)
|
surface.SetDrawColor(0, 0, 0, dmgalpha * 0.58)
|
||||||
|
|
Loading…
Reference in a new issue