From 8e2d9d172770369fda9f8089079c9cfbad1f7901 Mon Sep 17 00:00:00 2001 From: Player Name Date: Sun, 7 Dec 2025 07:51:39 +0100 Subject: [PATCH] Fix pt 2 - contentapi half --- Server/src/main/core/api/ContentAPI.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Server/src/main/core/api/ContentAPI.kt b/Server/src/main/core/api/ContentAPI.kt index 615e51996..c079e3a8b 100644 --- a/Server/src/main/core/api/ContentAPI.kt +++ b/Server/src/main/core/api/ContentAPI.kt @@ -386,7 +386,7 @@ fun replaceSlot(player: Player, slot: Int, item: Item, currentItem: Item? = null } if (cont.remove(currentItem, slot, true)) { - return cont.replace(item, slot) + return cont.replace(item, slot) ?: currentItem } PlayerMonitor.log(player, LogType.DUPE_ALERT, "Potential slot-replacement-based dupe attempt, slot: $slot, item: $item") @@ -394,8 +394,9 @@ fun replaceSlot(player: Player, slot: Int, item: Item, currentItem: Item? = null Container.INVENTORY -> Container.EQUIPMENT else -> Container.INVENTORY } - if (removeItem(player, currentItem, other)) - return cont.replace(item, slot) + if (removeItem(player, currentItem, other)) { + return cont.replace(item, slot) ?: currentItem + } return null }