Skip to content

Commit 9436f26

Browse files
authored
perf: remove unnecessary PreRender hook
1 parent 0242c6d commit 9436f26

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

cl_ui3d2d.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,8 @@ end
6262
do --Rendering context creation and mouse position getters
6363
local localPlayer
6464

65-
hook.Add("PreRender", "ui3d2d.getLocalPlayer", function() --Keep getting the local player until it's available
65+
hook.Add("InitPostEntity", "ui3d2d.getLocalPlayer", function() --Store a reference to the local player once available
6666
localPlayer = LocalPlayer()
67-
if IsValid(localPlayer) then hook.Remove("PreRender", "ui3d2d.getLocalPlayer") end
6867
end)
6968

7069
local traceLine = util.TraceLine

0 commit comments

Comments
 (0)