Fix books getting erased on page button use.
authorAuke Kok <sofar@foo-projects.org>
Sat, 29 Apr 2017 03:56:51 +0000 (20:56 -0700)
committerAuke Kok <sofar+github@foo-projects.org>
Sat, 29 Apr 2017 04:52:39 +0000 (21:52 -0700)
Changing the book page caused the entire itemstack meta to
get wiped due to improper calling of meta:from_table().

Fixes #1711

mods/default/craftitems.lua

index 75ac5507042ccbb9dfe1224e980a87e3a5742bba..33cdd5f664eb4d8e59f75f6d89c0b6cadbbc7b60 100644 (file)
@@ -139,7 +139,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
                        end
                end
 
-               stack:get_meta():from_table(data)
+               stack:get_meta():from_table({fields = data})
                stack = book_on_use(stack, player)
        end