qbcore-framework / qb-inventory

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

[BUG] Unqiue = false don't take care of metadata #583

Open Capy1174 opened 2 months ago

Capy1174 commented 2 months ago

Summary

if for a item that use metadata we make unique = false so in that if two same item name but different metadata they stack on each other then put the metadata of item which is already on a slot and new item with metadata stack on that make mess

Reproduction

1) Create a item like pizza 2) Add two item in inventory but both item should use different metadata info. 3) 1 item of pizza should have Size = 10 and another item of pizza should have size = 2 4) when u add these item one by one these will stack on each other and if u already have pizza size = 10 and you adding item with size = 2 then inventory will make both pizza item size = 10

Expected behavior

It should stack items when they have same metadata info but if any item has different metadata info it should not be stacked on item that has same name but different metadata info

Actual behavior

It not comparing metadata on unique = false

Additional context

its important if we using metadata in any item like a useable pizza item we can't make it unique for each pizza item if we do it will fill whole inventory slots just with eating item so it should stack if metadata if same even if unique = false

Last Updated

yesterday i check by downloading latest version of qb-inventory

Custom Resources

qb-inventory has this issue i use exports to add item with a command

Resource Rename

no i use name qb-inventory which is default name

CxCore-xyz commented 2 months ago

Or just create example:

pizza10 and pizza2 and use 2 items of that wouldn't be easier? you also need to add the item to consumables in the qb-smallresources wich does not use metadata and only uses item spawn name so it's your best option to use 2 seperate items.

Capy1174 commented 2 months ago

its all about meta cause i fill some detail for example if i want to make each pizza item slice like 8 slice in one pizza if u use once then 1 gone so 7 left so each item different from other if u eat single slice of any in that cause metadata must

CxCore-xyz commented 2 months ago

its all about meta cause i fill some detail for example if i want to make each pizza item slice like 8 slice in one pizza if u use once then 1 gone so 7 left so each item different from other if u eat single slice of any in that cause metadata must

Well if it's your vision then ya you must use metadata, But i would just make like the 10 slice pizza gives you 100percent of hunger and the let's say 5slices pizza would give you 50percent

Capy1174 commented 2 months ago

its just a use but in many case if item name is same and metadata is same its mean item is similar so thats good reason to make them stack on each other to save slots in inventory

github-actions[bot] commented 2 days ago

This issue has had 60 days of inactivity & will close within 7 days