Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion lua/entities/gmod_wire_hydraulic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
WireLib.TriggerOutput( self, "Damping", self.current_damping )
end

self:SetOverlayText(string.format("%s length: %.2f\nConstant: %i\nDamping: %i", (self.constraint.stretchonly and "Winch" or "Hydraulic"), curLength, self.current_constant, self.current_damping))

Check warning on line 75 in lua/entities/gmod_wire_hydraulic.lua

View workflow job for this annotation

GitHub Actions / lint

"Unnecessary parentheses"

Unnecessary parentheses
end

function ENT:SetConstraint( c, rope )
Expand Down Expand Up @@ -141,7 +141,9 @@
if not IsValid(controller) then return end

if not const then
WireHydraulicTracking[ MyEntId ] = controller
if MyEntId then
WireHydraulicTracking[ MyEntId ] = controller
end
else
controller.MyId = controller:EntIndex()
const.MyCrtl = controller:EntIndex()
Expand All @@ -165,8 +167,8 @@

local Phys1 = Ent1:GetPhysicsObjectNum( Bone1 )
local Phys2 = Ent2:GetPhysicsObjectNum( Bone2)
local WPos1 = Phys1:LocalToWorld( LPos1 )

Check warning on line 170 in lua/entities/gmod_wire_hydraulic.lua

View workflow job for this annotation

GitHub Actions / lint

"Unused variable"

Unused variable: WPos1
local WPos2 = Phys2:LocalToWorld( LPos2 )

Check warning on line 171 in lua/entities/gmod_wire_hydraulic.lua

View workflow job for this annotation

GitHub Actions / lint

"Unused variable"

Unused variable: WPos2

if ( Phys1 == Phys2 ) then return false end

Expand Down
4 changes: 3 additions & 1 deletion lua/entities/gmod_wire_motor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@
if not IsValid(controller) then return end

if not const then
WireMotorTracking[ MyEntId ] = controller
if MyEntId then
WireMotorTracking[ MyEntId ] = controller
end
else
controller.MyId = controller:EntIndex()
const.MyCrtl = controller:EntIndex()
Expand All @@ -78,8 +80,8 @@

local Phys1 = Ent1:GetPhysicsObjectNum( Bone1 )
local Phys2 = Ent2:GetPhysicsObjectNum( Bone2 )
local WPos1 = Phys1:LocalToWorld( LPos1 )

Check warning on line 83 in lua/entities/gmod_wire_motor.lua

View workflow job for this annotation

GitHub Actions / lint

"Unused variable"

Unused variable: WPos1
local WPos2 = Phys2:LocalToWorld( LPos2 )

Check warning on line 84 in lua/entities/gmod_wire_motor.lua

View workflow job for this annotation

GitHub Actions / lint

"Unused variable"

Unused variable: WPos2

if Phys1 == Phys2 then return false end

Expand Down
Loading