Skip to content

Commit

Permalink
perf: remove unnecessary PreRender hook
Browse files Browse the repository at this point in the history
  • Loading branch information
TomDotBat authored Sep 1, 2023
1 parent 0242c6d commit 9436f26
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions cl_ui3d2d.lua
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,8 @@ end
do --Rendering context creation and mouse position getters
local localPlayer

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

local traceLine = util.TraceLine
Expand Down

0 comments on commit 9436f26

Please sign in to comment.