Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent CD error on attempting to disable the CD's Lock #2960

Merged
merged 3 commits into from
Jan 4, 2024
Merged
Changes from 1 commit
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_cd_lock.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
function ENT:TriggerInput(iname, value)
if (iname == "Disable") then
self.DisableLinking = value
if (value >= 1) and (self.Const) then

Check warning on line 31 in lua/entities/gmod_wire_cd_lock.lua

View workflow job for this annotation

GitHub Actions / lint

"Unnecessary parentheses"

Unnecessary parentheses
self.Const:Remove()
--self.NoCollideConst:Remove()

Expand Down Expand Up @@ -97,7 +97,9 @@

self.Const:CallOnRemove("wire_cd_remove_on_weld",function()
self.Const = nil
self.Disk.Lock = nil
if(IsValid(self.Disk)) then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant parens, also it doesn't need to be valid but w/e

Copy link
Member Author

@DerelictDrone DerelictDrone Dec 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was following the isvalid check on file line 61, which I'd believed to be in the primary style of the rest of the file but it turns out it's just wildly inconsistent throughout the file anyway

self.Disk.Lock = nil
end
self.Disk = nil
self.NoCollideConst = nil

Expand Down
Loading