Skip to content

Commit

Permalink
Merge pull request #429 from wrefgtzweve/settingsload
Browse files Browse the repository at this point in the history
Use ACF_PersistedData_Loaded hook
  • Loading branch information
TwistedTail authored Sep 23, 2024
2 parents e2bb9d8 + 14a90a0 commit 0799c13
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 1 addition & 3 deletions lua/acf/core/globals.lua
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ end
if SERVER then
util.AddNetworkString("ACF_UpdateEntity")

hook.Add("PlayerConnect", "ACF Workshop Content", function()
hook.Add("ACF_PersistedData_Loaded", "ACF Workshop Content", function()
if ACF.WorkshopContent then
resource.AddWorkshop("2183798463") -- Playermodel Seats
resource.AddWorkshop("3248769144") -- ACF-3 Base
Expand All @@ -164,8 +164,6 @@ if SERVER then
resource.AddWorkshop("2099387099") -- ACF-3 Removed Sounds
resource.AddWorkshop("2782407502") -- ACF-3 Removed Models
end

hook.Remove("PlayerConnect", "ACF Workshop Content")
end)
elseif CLIENT then
CreateClientConVar("acf_show_entity_info", 1, true, false, "Defines under what conditions the info bubble on ACF entities will be shown. 0 = Never, 1 = When not seated, 2 = Always", 0, 2)
Expand Down
1 change: 1 addition & 0 deletions lua/acf/core/networking/data_vars/data_vars_sh.lua
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ do -- Data persisting
SetFunction(Key, Default)
end

hook.Run("ACF_PersistedData_Loaded")
hook.Remove("Initialize", "ACF Load Persisted Data")
end)
end
Expand Down

0 comments on commit 0799c13

Please sign in to comment.