Skip to content

Commit 552e0e3

Browse files
authored
Change color to use r g b a keys (#1971)
1 parent 6a6efc1 commit 552e0e3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lua/starfall/libs_sh/entities.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ function ents_methods:setColor(clr)
456456
checkpermission(instance, ent, "entities.setRenderProperty")
457457
end
458458

459-
local r,g,b,a = tonumber(clr[1]) or 255, tonumber(clr[2]) or 255, tonumber(clr[3]) or 255, tonumber(clr[4]) or 255
459+
local r,g,b,a = tonumber(clr.r) or 255, tonumber(clr.g) or 255, tonumber(clr.b) or 255, tonumber(clr.a) or 255
460460
local rendermode = (a == 255 and RENDERMODE_NORMAL or RENDERMODE_TRANSALPHA)
461461
Ent_SetColor4Part(ent, r, g, b, a)
462462
Ent_SetRenderMode(ent, rendermode)

0 commit comments

Comments
 (0)