qbcore-framework / qb-inventory

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

[BUG] Cannot detect some vehicle class trunk maxweight and slots #532

Open zedoppa opened 1 month ago

zedoppa commented 1 month ago

Summary

Tried using SUV vehicle class but it doesn't return SUV trunk maxweight or slots as set in config but return Config.Stash maxweight and slots instead

Reproduction

  1. Spawn vehicle with /car with SUV and Coupe vehicle class
  2. Go to trunk and open inventory
  3. It loads maxweight and slots of Config.Stash

Expected behavior

Load maxweight and slots for that specific vehicle class as set in config/vehicles.lua

Actual behavior

Load Config.Stash maxweight and slots

Additional context

Vehicle Class - Off-road (Correct) image Vehicle Class - SUV (Wrong) image

Last Updated

Today

Custom Resources

None

Resource Rename

Nope

Dudalypas commented 3 weeks ago

I recently discovered a fix for the bug in config/vehicles.lua. The issue lies in the configuration lines for vehicle categories. Currently, the code specifies maxWeight instead of trunkWeight. Here are the problematic lines:

[2] = { -- SUVs gloveboxSlots = 5, gloveboxWeight = 10000, trunkSlots = 50, maxWeight = 75000 }, [3] = { -- Coupes gloveboxSlots = 5, gloveboxWeight = 10000, trunkSlots = 35, maxWeight = 42000 }

To fix this, you need to change maxWeight to trunkWeight, like so:

[2] = { -- SUVs gloveboxSlots = 5, gloveboxWeight = 10000, trunkSlots = 50, trunkWeight = 75000 }, [3] = { -- Coupes gloveboxSlots = 5, gloveboxWeight = 10000, trunkSlots = 35, trunkWeight = 42000 }

After making this change, the bug should be resolved!