Skip to content

Commit 42796bc

Browse files
authored
wires hack fix
FindMetaTable("Color") call seems broken, the result is pretty much empty get the color metatable via the color object we created instead
1 parent 4db80ae commit 42796bc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lua/pac3/editor/client/wires.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@ local math_min = math.min
1616
local math_cos = math.cos
1717
local math_pi = math.pi
1818

19+
local black = Color(0,0,0,100)
20+
local vector_add = Vector(0, 2.5, 0)
21+
1922
local mtVector = FindMetaTable("Vector")
20-
local mtColor = FindMetaTable("Color")
23+
local mtColor = getmetatable(black)
2124
local render_startBeam = render.StartBeam
2225
local render_endBeam = render.EndBeam
2326
local render_addBeam = render.AddBeam
2427
local setVecUnpacked = mtVector.SetUnpacked
2528
local setColUnpacked = mtColor.SetUnpacked
2629
local colUnpack = mtColor.Unpack
2730

28-
local black = Color(0,0,0,100)
29-
local vector_add = Vector(0, 2.5, 0)
30-
3131
local function DrawHermite(width, x0,y0,x1,y1,c0,c1,alpha,samples)
3232

3333
--[[if x0 < 0 and x1 < 0 then return end

0 commit comments

Comments
 (0)