Hello!
I'm experiencing an issue where the doRemoveItem() function doesn't work properly during an onMoveItem event in certain scenarios. This problem occurs when stackable items are thrown, leading to various unexpected issues.
I've attempted to replace doRemoveItem(item.uid) with the following alternatives, but none of them seem to function correctly:
destoyItems.lua (inside data/scripts)
I'm experiencing an issue where the doRemoveItem() function doesn't work properly during an onMoveItem event in certain scenarios. This problem occurs when stackable items are thrown, leading to various unexpected issues.
I've attempted to replace doRemoveItem(item.uid) with the following alternatives, but none of them seem to function correctly:
- doRemoveItem(item.uid) -- This deletes all items in the stack.
- doRemoveItem(item.uid, count) -- When I throw 2 items, 4 items disappear from the bag, and 2 end up on the ground.
- doRemoveItem(item.uid, item.type) -- This also deletes all items in the stack.
destoyItems.lua (inside data/scripts)
Lua:
local ec = EventCallback
ec.onMoveItem = function(self, item, count, fromPosition, toPosition, fromCylinder, toCylinder)
if fromPosition.x == CONTAINER_POSITION and toPosition.x ~= CONTAINER_POSITION then
doRemoveItem(item.uid)
return RETURNVALUE_NOERROR
end
return RETURNVALUE_NOERROR
end
ec:register()