Fix bug with costs being deducted incorrectly
This commit is contained in:
parent
59c359a3a3
commit
b4acab145e
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user