dont log if 0 clipped entities on join

This commit is contained in:
Sevii 2024-08-25 00:44:02 +02:00
parent 08228a37ed
commit 9ea8a8b4d0
3 changed files with 10 additions and 8 deletions

View File

@ -8,7 +8,7 @@ local render_CullMode = render.CullMode
local render_PopCustomClipPlane = render.PopCustomClipPlane
local render_PushCustomClipPlane = render.PushCustomClipPlane
local entMeta = FindMetaTable( "Entity" )
local entMeta = FindMetaTable("Entity")
local GetTable = entMeta.GetTable
local GetPos = entMeta.GetPos
local GetAngles = entMeta.GetAngles
@ -16,11 +16,11 @@ local DrawModel = entMeta.DrawModel
local maxClips = cvar_clips:GetInt()
cvars.AddChangeCallback("proper_clipping_max_visual", function(_, _, new)
maxClips = tonumber( new )
maxClips = tonumber(new)
end)
local function renderOverride(self)
local selfTbl = GetTable( self )
local selfTbl = GetTable(self)
if not selfTbl.Clipped or not selfTbl.ClipData then return end
local prev = render_EnableClipping(true)

View File

@ -44,18 +44,18 @@ if CLIENT then
end
end)
end
hook.Add("PhysgunPickup", "proper_clipping_physics", function(_, ent)
if not clippedPhysics[ent] then return end
addHook()
return false
end)
hook.Add("PhysgunDrop", "proper_clipping_physics", function(_, ent)
if not clippedPhysics[ent] then return end
hook.Remove("Think", "proper_clipping_physics" )
hook.Remove("Think", "proper_clipping_physics")
end)
hook.Add("NetworkEntityCreated", "proper_clipping_physics", function(ent)
if ent.PhysicsClipped then
for _, clip in ipairs(ent.ClipData) do

View File

@ -236,7 +236,9 @@ hook.Add("PlayerInitialSpawn", "proper_clipping", function(ply)
clip_count = clip_count + #ent.ClipData
end
print("Sending " .. clip_count .. " clips from " .. ent_count .. " entities to " .. ply:GetName())
if ent_count > 0 then
print("Sending " .. clip_count .. " clips from " .. ent_count .. " entities to " .. ply:GetName())
end
hook.Remove("SetupMove", id)
end)