Dropping a unique item onto a unique item in the first 5 slots would result in the item being transferred successfully to the same destination slot as it came from. i.e. if a unique item from slot 3 in player inventory was dropped onto a unique item in slot 1 (occupied slot) in secondary inventory, it would transfer to slot 3 of the secondary inventory (somewhat incorrectly - it should fail). However, if slot 3 was also occupied, then the item would end up into a void and disappear. A good demonstration can be seen here: https://github.com/qbcore-framework/qb-inventory/issues/308#issuecomment-1305512700
This PR resolves this issue, by adding a check to ensure the slot being dragged to is empty before transferring the item. If the slot is not empty, the transfer will not occur preventing the issue.
Fixes #308.
Checklist
[x] I have personally loaded this code into an updated qbcore project and checked all of its functionality.
Description
Dropping a unique item onto a unique item in the first 5 slots would result in the item being transferred successfully to the same destination slot as it came from. i.e. if a unique item from slot 3 in player inventory was dropped onto a unique item in slot 1 (occupied slot) in secondary inventory, it would transfer to slot 3 of the secondary inventory (somewhat incorrectly - it should fail). However, if slot 3 was also occupied, then the item would end up into a void and disappear. A good demonstration can be seen here: https://github.com/qbcore-framework/qb-inventory/issues/308#issuecomment-1305512700
This PR resolves this issue, by adding a check to ensure the slot being dragged to is empty before transferring the item. If the slot is not empty, the transfer will not occur preventing the issue.
Fixes #308.
Checklist