From b4acab145ea6134a1c9d47e49df1c536d6086d1e Mon Sep 17 00:00:00 2001 From: Hugues Ross Date: Mon, 20 Apr 2020 06:28:52 -0400 Subject: [PATCH] Fix bug with costs being deducted incorrectly --- table.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/table.lua b/table.lua index 9ef39c5..c621d4d 100644 --- a/table.lua +++ b/table.lua @@ -423,7 +423,7 @@ minetest.register_on_player_receive_fields(function(player, name, fields) if is_positive and can_afford(cost, meta) then meta:set_int("paper", meta:get_int("paper") - cost.paper); - meta:set_int("pigment", meta:get_int("paper") - cost.pigment); + meta:set_int("pigment", meta:get_int("pigment") - cost.pigment); local inv = meta:get_inventory(); local stack = inv:get_stack("output", 1); @@ -448,7 +448,7 @@ minetest.register_on_player_receive_fields(function(player, name, fields) local cost = get_copy_material_cost(meta); if can_afford(cost, meta) then meta:set_int("paper", meta:get_int("paper") - cost.paper); - meta:set_int("pigment", meta:get_int("paper") - cost.pigment); + meta:set_int("pigment", meta:get_int("pigment") - cost.pigment); cartographer.map_sound("cartographer_write", player);