Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix nil error #435

Merged
merged 1 commit into from
Nov 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Loading