mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-24 03:21:05 +01:00
Clear itemstring when picking up or merging items (#4530)
Prevents possible item duplication with other mods. Matches the behavior of the default `__builtin:item`. See also https://github.com/mt-mods/pipeworks/issues/130 Reviewed-on: https://git.minetest.land/VoxeLibre/VoxeLibre/pulls/4530 Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land> Co-authored-by: OgelGames <ogelgames@noreply.git.minetest.land> Co-committed-by: OgelGames <ogelgames@noreply.git.minetest.land>
This commit is contained in:
parent
b8d7139792
commit
0012bdb71e
1 changed files with 2 additions and 0 deletions
|
@ -136,6 +136,7 @@ local function try_object_pickup(player, inv, object, checkpos)
|
|||
-- Destroy entity
|
||||
-- This just prevents this section to be run again because object:remove() doesn't remove the item immediately.
|
||||
le.target = checkpos
|
||||
le.itemstring = ""
|
||||
le._removed = true
|
||||
|
||||
-- Stop the object
|
||||
|
@ -957,6 +958,7 @@ minetest.register_entity(":__builtin:item", {
|
|||
self.random_velocity = 0
|
||||
self:set_item(own_stack:to_string())
|
||||
|
||||
entity.itemstring = ""
|
||||
entity._removed = true
|
||||
object:remove()
|
||||
return true
|
||||
|
|
Loading…
Reference in a new issue