Skip to content

Commit 4ef05dc

Browse files
Don't track parented NPCs either
1 parent cea75d5 commit 4ef05dc

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

lua/cfw/core/parenting_sv.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ hook.Add("Initialize", "CFW", function()
5656
if self._cfwRemoved then return end -- Removed by an undo
5757
if oldParent == newParent then return end
5858
if (validOldParent and oldParent:IsPlayer()) or (validNewParent and newParent:IsPlayer()) then return end
59+
if (validOldParent and oldParent:IsNPC()) or (validNewParent and newParent:IsNPC()) then return end
5960
if filter[self:GetClass()] then return end
6061

6162
if validOldParent then disconnect(self, oldParent:EntIndex(), isParent) end

lua/weapons/gmod_tool/stools/cfw_tool.lua

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ TOOL.Category = "Contraption Framework"
22
TOOL.Name = "CFW Tool"
33
TOOL.AddToMenu = false
44

5-
65
--[[
76
To access this, use 'gmod_tool cfw_tool'
87
Hidden because this relies on developer 1, so not for use by normal means, for now
@@ -17,7 +16,6 @@ TOOL.AddToMenu = false
1716
When this happens, maybe allow normal use of the tool as well?
1817
]]
1918

20-
2119
TOOL.Entity = nil
2220

2321
function TOOL:LeftClick(tr)
@@ -50,6 +48,7 @@ function TOOL:Think()
5048
local tick = engine.TickInterval() + 0.05
5149

5250
local Rendered = {}
51+
5352
for _, link in pairs(selftbl._links) do
5453
local entA, entB = link.entA, link.entB
5554
debugoverlay.Line(entA:GetPos(),entB:GetPos(),tick,link.color,true)
@@ -64,9 +63,6 @@ function TOOL:Think()
6463
debugoverlay.Text(entB:GetPos(),"B",tick,false)
6564
Rendered[entB] = true
6665
end
67-
68-
69-
7066
end
7167
end
7268

0 commit comments

Comments
 (0)