Skip to content

Commit

Permalink
Add Entity:getNetworkVars() (#1714)
Browse files Browse the repository at this point in the history
* Added Entity:getNetworkVars()

* Sanitized and error-proofed

* Added "table?"
  • Loading branch information
Some1Lambda authored Apr 28, 2024
1 parent 38f3d46 commit 1596b8d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lua/starfall/libs_sh/entities.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1895,4 +1895,13 @@ function ents_methods:mapCreationID()
return getent(self):MapCreationID()
end

--- Returns entity's networked variables table (data table).
-- @shared
-- @return table? The networked variables table of the entity or nil if it doesn't have one.
function ents_methods:getNetworkVars()
local ent = getent(self)
return istable(ent.dt) and instance.Sanitize(ent:GetNetworkVars()) or nil
end


end

0 comments on commit 1596b8d

Please sign in to comment.