Skip to content

Commit

Permalink
Merge pull request #435 from Astralcircle/patch-1
Browse files Browse the repository at this point in the history
Fix nil error
  • Loading branch information
thecraftianman authored Nov 1, 2024
2 parents dcfdc6f + c1bf73f commit 234fc13
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lua/acf/damage/damage_sv.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ end
--- @param NewHealth? number The entity's new amount of health.
--- @param MaxHealth? number The entity's maximum amount of health.
function Damage.Network(Entity, Target, NewHealth, MaxHealth)
NewHealth = NewHealth or Entity.ACF.NewHealth
MaxHealth = MaxHealth or Entity.ACF.MaxHealth
NewHealth = NewHealth or Entity.ACF.NewHealth or 0
MaxHealth = MaxHealth or Entity.ACF.MaxHealth or 0

local Value = math.Round(NewHealth / MaxHealth, 2)

Expand Down Expand Up @@ -227,4 +227,4 @@ hook.Add("ACF_OnPlayerLoaded", "ACF Render Damage", function(Player)

Damage.Network(Entity, Player)
end
end)
end)

0 comments on commit 234fc13

Please sign in to comment.