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 holograms not fixing renderbounds after fullupdate #1877

Merged
merged 3 commits into from
Oct 21, 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
25 changes: 18 additions & 7 deletions lua/entities/starfall_hologram/cl_init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,24 @@ end)

-- For when the hologram matrix gets cleared
hook.Add("NetworkEntityCreated", "starfall_hologram_rescale", function(holo)
if holo.IsSFHologram and holo.HoloMatrix then
holo:EnableMatrix("RenderMultiply", holo.HoloMatrix)
end
local sf_userrenderbounds = holo.sf_userrenderbounds
if sf_userrenderbounds then
holo:SetRenderBounds(sf_userrenderbounds[1], sf_userrenderbounds[2])
end
local sf_userrenderbounds = holo.sf_userrenderbounds
if holo.IsSFHologram then
if holo.HoloMatrix then
holo:EnableMatrix("RenderMultiply", holo.HoloMatrix)
end

if not sf_userrenderbounds then
local mins, maxs = holo:GetModelBounds()
if mins then
local scale = holo:GetScale()
holo:SetRenderBounds(mins * scale, maxs * scale)
end
end
end

if sf_userrenderbounds then
holo:SetRenderBounds(sf_userrenderbounds[1], sf_userrenderbounds[2])
end
end)

local function ShowHologramOwners()
Expand Down
Loading