From 517c36496d6facac560f469c817ee7d349025372 Mon Sep 17 00:00:00 2001 From: Breeze Date: Sat, 8 Aug 2026 14:48:40 +0200 Subject: [PATCH] Fix DropItem empty slot handling --- src/Libraries/Player.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Libraries/Player.cs b/src/Libraries/Player.cs index 59a3c73e4..69f151ca6 100644 --- a/src/Libraries/Player.cs +++ b/src/Libraries/Player.cs @@ -481,7 +481,7 @@ public void DropItem(BasePlayer player, int itemId) for (int s = 0; s < inventory.containerMain.capacity; s++) { global::Item i = inventory.containerMain.GetSlot(s); - if (i.info.itemid == itemId) + if (i != null && i.info.itemid == itemId) { i.Drop(position + new Vector3(0f, 1f, 0f) + position / 2f, (position + new Vector3(0f, 0.2f, 0f)) * 8f); } @@ -489,7 +489,7 @@ public void DropItem(BasePlayer player, int itemId) for (int s = 0; s < inventory.containerBelt.capacity; s++) { global::Item i = inventory.containerBelt.GetSlot(s); - if (i.info.itemid == itemId) + if (i != null && i.info.itemid == itemId) { i.Drop(position + new Vector3(0f, 1f, 0f) + position / 2f, (position + new Vector3(0f, 0.2f, 0f)) * 8f); } @@ -497,7 +497,7 @@ public void DropItem(BasePlayer player, int itemId) for (int s = 0; s < inventory.containerWear.capacity; s++) { global::Item i = inventory.containerWear.GetSlot(s); - if (i.info.itemid == itemId) + if (i != null && i.info.itemid == itemId) { i.Drop(position + new Vector3(0f, 1f, 0f) + position / 2f, (position + new Vector3(0f, 0.2f, 0f)) * 8f); }