Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,6 @@ local function createHydraulic(self, index, ent1, ent2, v1, v2, width, bone1, bo
if not checkCount( self, true ) then return end
local constraints = setupEntConstraints( ent1 )

width = math.Clamp(width, 0, 50)

local existing = constraints[index]
if IsValid( existing ) then existing:Remove() end

Expand All @@ -280,7 +278,7 @@ local function createHydraulic(self, index, ent1, ent2, v1, v2, width, bone1, bo
constant, damping = CalcElasticConsts( getBone(ent1,bone1), getBone(ent2,bone2), ent1, ent2 )
end

local cons, rope = constraint.Elastic( ent1, ent2, bone1 or 0, bone2 or 0, v1, v2, constant, damping, rdamping or 0, mat ~= "" and mat or "cable/cable2", width or 1, stretch ~= 0, color )
local cons, rope = constraint.Elastic( ent1, ent2, bone1 or 0, bone2 or 0, v1, v2, constant, damping, rdamping or 0, mat ~= "" and mat or "cable/cable2", width and math.Clamp(width, 0, 50) or 1, stretch ~= 0, color )
if not verifyConstraint( self, cons ) then return end

constraints[index] = cons
Expand Down Expand Up @@ -361,7 +359,7 @@ local function createRope(self, index, ent1, ent2, v1, v2, bone1, bone2, addleng
color = Color(color[1], color[2], color[3])
end

local cons, rope = constraint.Rope( ent1, ent2, bone1 or 0, bone2 or 0, v1, v2, length, addlength or 0, 0, width or 1, mat ~= "" and mat or "cable/rope", rigid ~= 0, color )
local cons, rope = constraint.Rope( ent1, ent2, bone1 or 0, bone2 or 0, v1, v2, length, addlength or 0, 0, width and math.Clamp(width, 0, 50) or 1, mat ~= "" and mat or "cable/rope", rigid ~= 0, color )
if not verifyConstraint( self, cons ) then return end

constraints[index] = cons
Expand Down Expand Up @@ -488,7 +486,7 @@ local function createSlider(self, ent1, ent2, v1, v2, width, bone1, bone2, mat,
color = Color(color[1],color[2],color[3],255)
end

local cons, rope = constraint.Slider( ent1, ent2, bone1 or 0, bone2 or 0, v1, v2, width or 1, mat ~= "" and mat or "cable/cable2", color )
local cons, rope = constraint.Slider( ent1, ent2, bone1 or 0, bone2 or 0, v1, v2, width and math.Clamp(width, 0, 50) or 1, mat ~= "" and mat or "cable/cable2", color )
if not verifyConstraint( self, cons ) then return end

postCreate(self, "Slider", cons, rope)
Expand Down
Loading