Skip to content

Commit 234d00c

Browse files
authored
Minor changes to wire keypad (#3374)
Check distance via EyePos because it will prevent keypads from being drawed on cameras Create one less vector
1 parent 26d2710 commit 234d00c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lua/entities/gmod_wire_keypad.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,18 @@ if CLIENT then
4949
function ENT:Draw()
5050
self:DrawModel()
5151

52-
local ply = LocalPlayer()
5352
local entpos = self:GetPos()
54-
if entpos:Distance(ply:GetShootPos()) > 512 then return end
53+
if entpos:Distance(EyePos()) > 512 then return end
5554

5655
local ang = self:GetAngles()
57-
entpos = entpos + self:GetForward() * 1.05
56+
entpos:Add(self:GetForward() * 1.05)
5857

5958
ang:RotateAroundAxis(ang:Right(), -90)
6059
ang:RotateAroundAxis(ang:Up(), 90)
6160
ang:RotateAroundAxis(ang:Forward(), 0)
6261

6362
cam.Start3D2D(entpos, ang, 0.05)
63+
local ply = LocalPlayer()
6464
local trace = ply:GetEyeTrace()
6565
local pos = self:WorldToLocal(trace.HitPos)
6666

0 commit comments

Comments
 (0)