diff options
author | ShadowNinja <noreply@gmail.com> | 2013-09-28 18:36:45 -0400 |
---|---|---|
committer | ShadowNinja <noreply@gmail.com> | 2013-09-28 18:36:45 -0400 |
commit | 88a740c8405001a023c3232dba115c2df826e5fd (patch) | |
tree | a85f20e7ba0c4941d6b2bf9c97fa3ef22836304a /callbacks.lua | |
parent | f974fd8c2c8532179edea54643fb10fa4091f322 (diff) |
Use ItemStack:set_count()
Diffstat (limited to 'callbacks.lua')
-rw-r--r-- | callbacks.lua | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/callbacks.lua b/callbacks.lua index d8c8853..32a096c 100644 --- a/callbacks.lua +++ b/callbacks.lua @@ -39,9 +39,8 @@ minetest.register_on_joinplayer(function(player) end end, on_put = function(inv, listname, index, stack, player) - local stacktable = stack:to_table() - stacktable.count = stack:get_stack_max() - inv:set_stack(listname, index, ItemStack(stacktable)) + stack:set_count(stack:get_stack_max()) + inv:set_stack(listname, index, stack) minetest.sound_play("electricity", {to_player=player_name, gain = 1.0}) end, }) |