diff --git a/lua/starfall/libs_sh/entities.lua b/lua/starfall/libs_sh/entities.lua index fae5ddc88..27bdecd8c 100644 --- a/lua/starfall/libs_sh/entities.lua +++ b/lua/starfall/libs_sh/entities.lua @@ -237,7 +237,6 @@ if CLIENT then local ent = getent(self) if not ent.IsSFHologram and not ent.IsSFProp then SF.Throw("The entity isn't a hologram or custom-prop", 2) end - checkpermission(instance, ent, "entities.setRenderProperty") mins, maxs = vunwrap(mins), vunwrap(maxs) @@ -245,6 +244,17 @@ if CLIENT then ent.sf_userrenderbounds = {mins, maxs} end + --- Returns render bounds of the entity as local vectors + -- If the render bounds are not inside players view, the entity will not be drawn! + -- @client + -- @return Vector The minimum vector of the bounds + -- @return Vector The maximum vector of the bounds + function ents_methods:getRenderBounds() + local ent = getent(self) + local mins, maxs = ent:GetRenderBounds() + return vwrap(mins), vwrap(maxs) + end + --- Sets the Level Of Detail model to use with this entity. This may not work for all models if the model doesn't include any LOD sub models. -- This function works exactly like the clientside r_lod convar and takes priority over it. -- -1 leaves the engine to automatically set the Level of Detail. The Level Of Detail may range from 0 to 8, with 0 being the highest quality and 8 the lowest.