1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-06 17:41:04 +00:00

Fix InvRef bugs and add unit tests (#14591)

This commit is contained in:
OgelGames 2024-04-28 08:13:44 +10:00 committed by GitHub
parent 815b5cb086
commit 05d5dc4cec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 92 additions and 8 deletions

View file

@ -7456,6 +7456,7 @@ An `InvRef` is a reference to an inventory.
* returns `false` on error (e.g. invalid `listname` or `size`)
* `get_width(listname)`: get width of a list
* `set_width(listname, width)`: set width of list; currently used for crafting
* returns `false` on error (e.g. invalid `listname` or `width`)
* `get_stack(listname, i)`: get a copy of stack index `i` in list
* `set_stack(listname, i, stack)`: copy `stack` to index `i` in list
* `get_list(listname)`: returns full list (list of `ItemStack`s)