From 0666041450db4f2a1c2718259dee71430cec862d Mon Sep 17 00:00:00 2001 From: Lucasgood5 <65530145+Lucasgood5@users.noreply.github.com> Date: Mon, 24 Jul 2023 12:38:04 +0200 Subject: [PATCH] Fix sh_item.lua ITEM:Remove() client Found an issue where using ITEM:Remove() inside a item.function and not returning value make the item try to delete twice, causing an error on line 446/447 : `inv.slots[x][y] = v.id` where it try to index nil value. This add should fix this error. --- gamemode/core/meta/sh_item.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/gamemode/core/meta/sh_item.lua b/gamemode/core/meta/sh_item.lua index 767b7c44a..a5dd2718f 100644 --- a/gamemode/core/meta/sh_item.lua +++ b/gamemode/core/meta/sh_item.lua @@ -442,6 +442,7 @@ function ITEM:Remove(bNoReplication, bNoDelete) for _, v in pairs(items) do if (v.invID == inv:GetID()) then for x = self.gridX, self.gridX + (self.width - 1) do + inv.slots[x]={} for y = self.gridY, self.gridY + (self.height - 1) do inv.slots[x][y] = v.id end