qbcore-framework / qb-inventory

Slot Based Inventory System Used With QB-Core :school_satchel:
GNU General Public License v3.0
50 stars 376 forks source link

[BUG] Trunk/Apartment Stash Lost Items #308

Closed nzkfc closed 1 year ago

nzkfc commented 2 years ago

Describe the bug When we had lj-inventory we had issues where inventory items would just go into a void, it would either be: Apartment stash: they would move items and it would just drop on the floor, but they could not see the drop due to the way apartments work, someone else in their apartment would get a random item on the floor.

Vehicle trunk: players would move a stack of items into their trunk or similar and it would just POOF and dissapear.

SO we moved over to qb-inventory and found the issue still exists, it's intermittent but does happen everyday for a lot of players, our ticket system is full of refund requests.

To Reproduce Intermittent but:

  1. Transfer say a stack of 10 items
  2. It drops into a void OR it goes into the stash/trunk
  3. Close stash/trunk and go back in and it's not there.

Expected behavior Trunk/stash movements work

Screenshots An example of a trunk move getting lost: https://medal.tv/clips/u3YKv6t3-UDHc/vpK2EQh22?invite=cr-MSxueUgsNjIyMDMxMDQs

Questions (please complete the following information):

Additional context N/A

nzkfc commented 2 years ago

Just to add to this, it seems to happen a lot when people drag say a pistol onto another thinking it will stack, says it can't but eats the gun (right away or after closing inventory)

Or if you say drop a pistol onto handcuffs

Z3MO commented 2 years ago

Your Inv was full that's why it disappeared , my inv performs perfectly. If the inv is full its shouldn't take items in your inv.

nzkfc commented 2 years ago

Your Inv was full that's why it disappeared , my inv performs perfectly. If the inv is full its shouldn't take items in your inv.

Nope, clearly you can see the pock weight: https://i.imgur.com/iWOBTT8.png

He dragged more weight then he could hold into pocket from the trink, the notification confirms that, however the wheels still dissapeared....

The ISSSUE is that if you drag something into a stash/pocket/trunk or whichever and the destination is full, it should state that but not make the item go away from either.....

nzkfc commented 2 years ago

Some more examples, we average about 10 tickets a day for missing items, mostly apartment stash dropping instead of going into stash.

https://i.imgur.com/8ihQ0uB.png

https://medal.tv/games/gta-v/clips/xCoDWFMo7odqH/sbETIolxQGGw?invite=cr-MSwwUkEsODUyNjMyNjIs

Can see he drags the pump over to the pistol, they swap, then on exit he gets the pistol back and opens boot and the pump, AK and a MK2 pistol is gone burgers.

Aero-Codes commented 2 years ago

Try this fix

https://github.com/qbcore-framework/qb-inventory/pull/348/commits/3fb2a13c49357122840555b623753f44a5413a3e

nzkfc commented 2 years ago

Try this fix

3fb2a13

Thanks, I gave it a go and it seems to be working, however I noticed items that are stackable can no longer stack?

Video: https://youtu.be/YqH7FQGqyY0

Example stone:


        ["stone"]                        = {["name"] = "stone",                         ["label"] = "Stone",                    ["weight"] = 100,       ["type"] = "item",      ["image"] = "stone.png",                ["unique"] = false,     ["useable"] = false,    ["shouldClose"] = false,   ["combinable"] = nil,   ["description"] = "Just a Stone"},```
Aero-Codes commented 2 years ago

It shouldn't be a problem maybe you did it wrong. the one, I did is it check if the item is unique item

nzkfc commented 1 year ago

I just did a full update of all qb- scripts, hoping the changes I saw between qb-core and qb-inventory was to resolve this issue but it seems it's not. Moving an item from inventory to stash and dropping it ontop of another item seems to make the item go away after you re-open inventory.

Example video: https://www.youtube.com/watch?v=ZkdSaa8Gic4

nzkfc commented 1 year ago

Seems it's related to slot 1 and the items in it,

For example if I put a pistol in slot 3 and 4 of the stash/trunk, then I go out and back in, drag a 3rd pistol from inventory and drop it onto slot 3, it will put the dragged pistol into slot 2 on re-opening of stash/trunk.

If you then do the above but drag a 4th to slot 2, it goes into slot 1. Everything is fine.

But if you have anything in slot 1 and try to drag onto slot 2/3/4 etc that is the SAME item as whats being dragged and is unique, then the first slot of trunk/stash gets nuked.

Here is another example which clearly shows the issue: https://youtu.be/cqRPjYNtzcg

Ideally what needs to happen is if you drag a unique onto another, it should notify the player "You cannot stack this item" or similar, then either not transfer it, or maybe pop it into a spare slot (if not room then "You have no space to move this" or similar.

nzkfc commented 1 year ago

It shouldn't be a problem maybe you did it wrong. the one, I did is it check if the item is unique item

Did you managed to re-work that PR?

nzkfc commented 1 year ago

It shouldn't be a problem maybe you did it wrong. the one, I did is it check if the item is unique item

Did you managed to sort that original PR? the one that fixed it but stopped the ability to stack non-unique items?

tom-osborne commented 1 year ago

I am struggling to replicate this. I am guessing it is intermittent?

nzkfc commented 1 year ago

Nope it's simply any time a player drops items on a unique item and it can't stack so it writes over slot 1

Or if you combine non unique then it sometimes removes the whole stack.

I'll pull a fresh qb server down and re-test/record it.

On Mon, 7 Nov 2022, 2:02 am Stan, @.***> wrote:

I am struggling to replicate this. I am guessing it is intermittent?

— Reply to this email directly, view it on GitHub https://github.com/qbcore-framework/qb-inventory/issues/308#issuecomment-1304796988, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABGHUHOTDETKWHIT4KO62U3WG6T7ZANCNFSM54YUZD2A . You are receiving this because you authored the thread.Message ID: @.***>

nzkfc commented 1 year ago

I am struggling to replicate this. I am guessing it is intermittent?

It seems if you drag items into slot 2/3/4/5/6 etc in the trunk/stash/glovebox and the item is unique, it gets confused and zaps slot 1 item and then so on.

I wipe my qb-core local that only has default recipie, booted up and made new character and then did the inventory bug:

Trunk Example: https://youtu.be/vYKFu2CJtEo Stash Example: https://youtu.be/5UacTKonBEs

tom-osborne commented 1 year ago

Interesting, thats a good demonstration thanks for that. I will look into it this week.

tom-osborne commented 1 year ago

I am struggling to replicate this. I am guessing it is intermittent?

It seems if you drag items into slot 2/3/4/5/6 etc in the trunk/stash/glovebox and the item is unique, it gets confused and zaps slot 1 item and then so on.

I wipe my qb-core local that only has default recipie, booted up and made new character and then did the inventory bug:

Trunk Example: https://youtu.be/vYKFu2CJtEo Stash Example: https://youtu.be/5UacTKonBEs

Replicated this after following the steps in your video. Thank you for that demonstration.

I belive the above linked PR fixes this issue properly, but I will leave it open for testing to make sure. It seemed to work 100% for that specific test case during my testing, but I think this would benefit from a few other testers.

nzkfc commented 1 year ago

I am struggling to replicate this. I am guessing it is intermittent?

It seems if you drag items into slot 2/3/4/5/6 etc in the trunk/stash/glovebox and the item is unique, it gets confused and zaps slot 1 item and then so on. I wipe my qb-core local that only has default recipie, booted up and made new character and then did the inventory bug: Trunk Example: https://youtu.be/vYKFu2CJtEo Stash Example: https://youtu.be/5UacTKonBEs

Replicated this after following the steps in your video. Thank you for that demonstration.

I belive the above linked PR fixes this issue properly, but I will leave it open for testing to make sure. It seemed to work 100% for that specific test case during my testing, but I think this would benefit from a few other testers.

Try it with a stackable item like washed_stone or something, with the above fix, as far as I remember, when I implemented this it worked but it also broke non-unique items being stacked, they just won't stack after. I mentioned this but the guy just kept saying I implemented it incorrectly lol (not saying it could be something we customised though)

I will re-test with this fix on fresh in 5 hours and have a look.

tom-osborne commented 1 year ago

Yeah you could be right, I was afraid of something like that. I'll test stacked items

tom-osborne commented 1 year ago

Stacked items seem to work fine for me.

nzkfc commented 1 year ago

Stacked items seem to work fine for me.

IIIIITTTTTTT WOOOOOOOOOOOOOOOOOOKRS! WOOOOOOOOOOOOOOOOOOOOO!

BOX IT!

SHIP IT!

<3