Skip to content
Open
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
17 changes: 15 additions & 2 deletions imgui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,15 @@ end
local _devMode = false -- cached local variable updated once in a while

function imgui.Hook(name, id, callback)
local hookUniqifier = debug.getinfo(4).short_src
-- find deepest known source
local shortsrc = "unknown"
for i=0,4 do
if debug.getinfo(i) then
shortsrc = debug.getinfo(i).short_src
end
end

local hookUniqifier = shortsrc
hook.Add(name, "IMGUI / " .. id .. " / " .. hookUniqifier, callback)
end

Expand Down Expand Up @@ -167,7 +175,12 @@ function imgui.Start3D2D(pos, angles, scale, distanceHide, distanceFadeStart)

local hitPos = util.IntersectRayWithPlane(eyepos, eyenormal, pos, planeNormal)
if hitPos then
local obstructed, obstructer = isObstructed(eyepos, hitPos, gState.entity, true)
local obstructed, obstructer = false, nil

if gState.entity then
local obstructed, obstructer = isObstructed(eyepos, hitPos, gState.entity, true)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
local obstructed, obstructer = isObstructed(eyepos, hitPos, gState.entity, true)
obstructed, obstructer = isObstructed(eyepos, hitPos, gState.entity, true)

end

if obstructed then
gState.mx = nil
gState.my = nil
Expand Down
Loading