Skip to content

Commit

Permalink
Update persistence.lua
Browse files Browse the repository at this point in the history
add Entity:OnHelixPersistLoad/OnHelixPersistSave
  • Loading branch information
Be1zebub authored Dec 21, 2024
1 parent 83e8cc9 commit a2046ab
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions plugins/persistence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ if (SERVER) then
entity:RestoreNetworkVars(v.DT)
end

if (entity.OnHelixPersistLoad) then
entity:OnHelixPersistLoad()
end

self.stored[#self.stored + 1] = entity

entity:SetNetVar("Persistent", true)
Expand Down Expand Up @@ -212,6 +216,10 @@ if (SERVER) then
data.DT = v:GetNetworkVars()
end

if (v.OnHelixPersistSave) then
v:OnHelixPersistSave(data)
end

entities[#entities + 1] = data
end
end
Expand Down

0 comments on commit a2046ab

Please sign in to comment.