-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inventory list: inv:set_list() not working anymore according to docs #13490
Comments
dup #13465 |
How is this a dup? The mentioned issue (#13465) was already closed with a merged solution, but I encountered this bug with the latest git pull. In the meantime I have to work around this everywhere by using a |
#13465 is similar, but it was fixed by allowing resizing in more situations (i.e. if the list is the destination in a listring operation). |
I admit I didn't check the commit hash and assumed that we'd already fixed this entirely. |
The solution here might be to refresh all inventory list pointers within the inventory action code after each callback execution to avoid bad memory access in subsequent callbacks. That will again make the code slower and more complicated/bloated than it already is but eventually solves the issue. |
Cannot reproduce in current master, either due to #13497 or follow-up PRs. |
Obligatory Minetest version
OS / Hardware
Operating system: 6.2.6-76060206-generic
CPU: dunno, why?
Summary
Use of
inv:set_list("listname", {})
insideon_metadata_inventory_take
causes error from Lua:This is a problem, because the docs for
inv:set_list()
state:There's a mod running on my server which expected
inv:set_list()
to do what it used to do a couple Minetest versions ago: that is, to set all (or just most) of the itemstacks in a list at once, without changing its size. (IIRC, I think Minetest would clear out the bits of the inventory list not present in the method's table argument, in the case that the table contained too few elements to fill the whole list?)Pedantic steps to reproduce
The text was updated successfully, but these errors were encountered: