Added a connection check before attempting to disconnect

- CFW.disconnect will now actually check if both entities are connected before doing anything.
This commit is contained in:
TwistedTail 2024-06-23 03:51:14 -04:00
parent 839af48129
commit 2aafe1b6b6

View File

@ -65,7 +65,10 @@ end
function CFW.disconnect(entA, indexB)
if entA:EntIndex() == indexB then return end -- Should not happen normally, but ragdolls allow you to constrain to other bones on the same ragdoll, and it is the same entity
local link = entA._links[indexB]
local link = entA._links[indexB]
if not link then return end -- There's nothing to disconnect here
local contraptionPopped = link:Sub()
if contraptionPopped then return end