This appeared to only happen with `jim-mechanic` repair from stash, due to the stashitem's table not being sent to the function
Making it save an empty table to the database
But this was possible in other places too
I've added fallbacks for if it didn't receive a table, grab a fresh one from cache/database
Mainly older inventories may have had issues with custom stash sizes when opening them
This should fix compatibility with changing slots and max weight with them on trigger
PS-Inv used to be exactly the same as QB-Inv so alot of the function calls were shared
This separates them and makes it easier to make changes to support their inventory
Also unified the calls for server side functions into single functions instead of having separate per inventory
Also moves:
- `invImg()` to inventories.lua
- `registerStash()` to stashcontrol.lua
This'll probably break it, (it works for me) but refactored the stash item check, it was calling `stashHasItem()` for every ingredient check, now it sends the whole table of ingredients per item to craft and checks them together instead of separately
Also removes a `Wait()`, as it shouldn't need it with this change..maybe
I think, if ox_inventory checks a stash that doesn't exist yet, it returns a boolean or `nil`
This checks for that and instead returns a table to hopefully stop the scripts from breaking