mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-06 17:41:04 +00:00
Fix core.item_eat for same-item replace_with_item and split stacks before dropping (#13286)
The replace_with_item can be added to the slot of the wield item, which is afterwards overwritten. This causes item loss.
This commit is contained in:
parent
2180dc14ef
commit
ea095d3f69
2 changed files with 14 additions and 16 deletions
|
@ -6082,8 +6082,8 @@ Defaults for the `on_place` and `on_drop` item definition functions
|
|||
* Returns `function(itemstack, user, pointed_thing)` as a
|
||||
function wrapper for `minetest.do_item_eat`.
|
||||
* `replace_with_item` is the itemstring which is added to the inventory.
|
||||
If the player is eating a stack, then replace_with_item goes to a
|
||||
different spot.
|
||||
If the player is eating a stack and `replace_with_item` doesn't fit onto
|
||||
the eaten stack, then the remainings go to a different spot, or are dropped.
|
||||
|
||||
Defaults for the `on_punch` and `on_dig` node definition callbacks
|
||||
------------------------------------------------------------------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue