summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Pérez-Cerezo <gabriel@gpcf.eu>2016-06-28 15:31:08 +0200
committerGabriel Pérez-Cerezo <gabriel@gpcf.eu>2016-06-28 15:31:08 +0200
commit3ded6d7ab3b92ac91cd2db2246a7fc752046ce55 (patch)
tree8a3207913ffd161a0cad6efc405f96990de66e98
parent70aace56b189ea547827a8eb6ead7584c4848ceb (diff)
Don't sell now actually doesn't sell the nodeHEADorigin/masterorigin/HEADmaster
-rw-r--r--init.lua9
1 files changed, 5 insertions, 4 deletions
diff --git a/init.lua b/init.lua
index 7fa5eb5..339f92c 100644
--- a/init.lua
+++ b/init.lua
@@ -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