Fix "ghost stacks" created when a player clicks an item on the ground:
authorNovatux <nathanael.courant@laposte.net>
Tue, 18 Mar 2014 19:02:18 +0000 (20:02 +0100)
committerNovatux <nathanael.courant@laposte.net>
Sat, 22 Mar 2014 17:15:33 +0000 (18:15 +0100)
since the object is not immediately removed, any other code may still
think an object is there, therefore leading to item duplication. This code
therefore sets the itemstring to '' after the object is picked up to avoid
such issues

builtin/item_entity.lua

index 95affe3da0cd083002198b62ec03200aea8cfbec..0dcc2dc2d57f219ef1c7cd244a041abeaecc8ef4 100644 (file)
@@ -116,6 +116,7 @@ minetest.register_entity("__builtin:item", {
                                return
                        end
                end
+               self.itemstring = ''
                self.object:remove()
        end,
 })