diff options
Diffstat (limited to 'init.lua')
-rw-r--r-- | init.lua | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -603,10 +603,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) if fields.sell then minetest.show_formspec(player:get_player_name(), "sell"..formname, protector.generate_sale_formspec(meta,pos)) end - if fields.sell then - swap_node(pos, "protector:protect_sell") - meta:set_string("infotext", S("Protection for sale (owned by @1)", meta:get_string("owner"))) - end + end if string.sub(formname, 0, string.len("sellprotector:node_")) == "sellprotector:node_" then @@ -624,6 +621,10 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) end end meta:set_string("price", minetest.serialize(price)) + if fields.ok then + swap_node(pos, "protector:protect_sell") + meta:set_string("infotext", S("Protection for sale (owned by @1)", meta:get_string("owner"))) + end if not fields.ok and not fields.dont_sell then minetest.show_formspec(player:get_player_name(), formname, protector.generate_sale_formspec(meta,pos)) end |