This commit is contained in:
Nordi98 2025-06-12 16:16:47 +02:00
parent f10ca59400
commit 26083791e2
4 changed files with 16 additions and 2 deletions

View file

@ -25,6 +25,17 @@ local function cleanupEntities()
end
end

-- Cleanup other players weapons
for playerId, weapons in pairs(otherPlayersWeapons) do
for weaponName, _ in pairs(weapons) do
if Sling.cachedAttachments[weaponName] then
safeDelete(Sling.cachedAttachments[weaponName].obj)
safeDelete(Sling.cachedAttachments[weaponName].placeholder)
end
end
otherPlayersWeapons[playerId] = nil
end

Sling.currentAttachedAmount = 0
collectgarbage("collect")
end