mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-17 21:53:46 +03:00
Upload
This commit is contained in:
39
lua/arccw/server/sv_garbage.lua
Normal file
39
lua/arccw/server/sv_garbage.lua
Normal file
@@ -0,0 +1,39 @@
|
||||
--[[
|
||||
| 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)
|
||||
Reference in New Issue
Block a user