Skip to content

Commit

Permalink
fix svlua exploit (#2008)
Browse files Browse the repository at this point in the history
* fix svlua exploit

* my dumbass

* proper fix
  • Loading branch information
meetric1 authored Feb 24, 2025
1 parent 00fa72a commit a724193
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions lua/starfall/libs_sv/constraint.lua
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,8 @@ function constraint_library.elastic(index, e1, e2, bone1, bone2, v1, v2, const,
if ent then
entList:register(instance, ent)

e1.Elastics[index] = ent
e2.Elastics[index] = ent
ent1.Elastics[index] = ent
ent2.Elastics[index] = ent
return cwrap(ent)
end
end
Expand Down Expand Up @@ -375,8 +375,8 @@ function constraint_library.rope(index, e1, e2, bone1, bone2, v1, v2, length, ad
if ent then
entList:register(instance, ent)

e1.Ropes[index] = ent
e2.Ropes[index] = ent
ent1.Ropes[index] = ent
ent2.Ropes[index] = ent
return cwrap(ent)
end
end
Expand Down Expand Up @@ -490,8 +490,8 @@ function constraint_library.setElasticLength(index, e, length)
checkluatype(length, TYPE_NUMBER)
length = math.max(length, 0)

if e.Elastics then
local con = e.Elastics[index]
if ent1.Elastics then
local con = ent1.Elastics[index]
if IsValid(con) then
con:Fire("SetSpringLength", length, 0)
end
Expand All @@ -512,8 +512,8 @@ function constraint_library.setElasticDamping(index, e, damping)
checkluatype(damping, TYPE_NUMBER)
damping = math.max(damping, 0)

if e.Elastics then
local con = e.Elastics[index]
if ent1.Elastics then
local con = ent1.Elastics[index]
if IsValid(con) then
con:Fire("SetSpringDamping", damping, 0)
end
Expand All @@ -534,8 +534,8 @@ function constraint_library.setElasticConstant(index, e, constant)
checkluatype(constant, TYPE_NUMBER)
constant = math.max(constant, 0)

if e.Elastics then
local con = e.Elastics[index]
if ent1.Elastics then
local con = ent1.Elastics[index]
if IsValid(con) then
con:Fire("SetSpringConstant", constant, 0)
end
Expand Down

0 comments on commit a724193

Please sign in to comment.