mirror of
https://github.com/Winded/RagdollMover.git
synced 2025-03-04 03:13:36 -05:00
Do subtraction of maxdist before loop
This commit is contained in:
parent
24cdf226b6
commit
5f1fea75ad
@ -1133,6 +1133,7 @@ function AdvBoneSelectRender(ent, bonenodes)
|
||||
if not maxdist or maxdist < dist then maxdist = dist end
|
||||
bonedistances[i] = dist
|
||||
end
|
||||
maxdist = maxdist - mindist
|
||||
|
||||
local selectedBones = {}
|
||||
for i = 0, ent:GetBoneCount() - 1 do
|
||||
@ -1156,7 +1157,7 @@ function AdvBoneSelectRender(ent, bonenodes)
|
||||
table.insert(selectedBones, {name, i})
|
||||
else
|
||||
if nodesExist and bonenodes[ent][i] and bonenodes[ent][i].Type then
|
||||
local fraction = ( bonedistances[i] - mindist ) / (maxdist - mindist)
|
||||
local fraction = ( bonedistances[i] - mindist ) / maxdist
|
||||
fraction = math.max(1, math.ceil(fraction * NUM_GRADIENT_POINTS))
|
||||
surface.SetDrawColor(BONETYPE_COLORS[bonenodes[ent][i].Type][fraction]:Unpack())
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user