Closed dvdvideo1234 closed 1 year ago
function ClearGhosts(vSiz, bCol)
print(1)
if(SERVER) then return true end
print(2)
local tGho = GetOpVar("ARRAY_GHOST")
print(3)
if(not IsHere(tGho)) then return true end
local iSiz = mathCeil(tonumber(vSiz) or tGho.Size)
print(4, iSiz)
for iD = 1, iSiz do local eGho = tGho[iD]
if(eGho and eGho:IsValid()) then
print(5, eGho)
eGho:SetNoDraw(true); eGho:Remove()
end; eGho, tGho[iD] = nil, nil
end; tGho.Size, tGho.Slot = 0, GetOpVar("MISS_NOMD")
if(bCol) then collectgarbage() end; return true
end
https://wiki.facepunch.com/gmod/Global.SafeRemoveEntityDelayed https://wiki.facepunch.com/gmod/timer.Simple
SetNoDraw doesn’t prevent the object from being drawn using DrawModel. You might not be
despawning the clientside model. If you draw the model with it set to no draw, it’ll still be
drawable when using DrawModel. Check and see if you can find if the entity exists after being
removed. It looks like it’s probably the above issue. If the client model is removed, properly, it’ll be gone.
Describe the bug TA does not clear client ghosts on request
To Reproduce Steps to reproduce the behavior:
Expected behavior Ghosts to be deleted on swtch
Screenshots
Host machine (please complete the following information):
Additional context