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 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
5 changes: 4 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 @@ -96,8 +96,11 @@
end

self.Const:CallOnRemove("wire_cd_remove_on_weld",function()
if not self:IsValid() then return end
self.Const = nil
self.Disk.Lock = nil
if IsValid(self.Disk) then
self.Disk.Lock = nil
end
self.Disk = nil
self.NoCollideConst = nil

Expand Down
Loading