Files
wnsrc/lua/arccw/server/sv_garbage.lua
lifestorm 9c918c46e5 Upload
2024-08-04 23:12:27 +03:00

39 lines
922 B
Lua

--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
if CLIENT then return end
ArcCW.ShieldPropPile = {} -- { {Model = NULL, Weapon = NULL} }
local function SV_ArcCW_CollectGarbage()
local removed = 0
local newpile = {}
for _, k in pairs(ArcCW.ShieldPropPile) do
if IsValid(k.Weapon) then
table.insert(newpile, k)
continue
end
SafeRemoveEntity(k.Model)
removed = removed + 1
end
ArcCW.ShieldPropPile = newpile
if GetConVar("developer"):GetBool() and removed > 0 then
print("Removed " .. tostring(removed) .. " Shield Models")
end
end
timer.Create("ArcCW Shield Model Garbage Collector", 5, 0, SV_ArcCW_CollectGarbage)