Skip to content

Commit

Permalink
fix(server/inventory): don't wipe entity inventories overtime
Browse files Browse the repository at this point in the history
Resolves #1494.
  • Loading branch information
thelindat committed Oct 1, 2023
1 parent a25ec83 commit 0231495
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/inventory/server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2271,7 +2271,7 @@ local function saveInventories(clearInventories)
for _, inv in pairs(Inventories) do
if not inv.open and not inv.player then
-- clear inventory from memory if unused for 10 minutes, or invalid entity
if time - inv.time >= 600 or (inv.netid and NetworkGetEntityFromNetworkId(inv.netid) == 0) then
if (not inv.netid and time - inv.time >= 600) or (inv.netid and NetworkGetEntityFromNetworkId(inv.netid) == 0) then
Inventory.Remove(inv)
end
end
Expand Down

0 comments on commit 0231495

Please sign in to comment.