master
rnd1 2016-09-21 14:29:20 +02:00
parent 9e107c4b90
commit 0dff5a343d
1 changed files with 18 additions and 14 deletions

View File

@ -102,6 +102,9 @@ minetest.register_node("shop:shop", {
return
end
local err = "";
if meta:get_int("admin_shop")~=1 then -- check shop
if inv:is_empty("sell") or
inv:is_empty("buy") or
(not inv:room_for_item("register", b[1])) then
@ -109,17 +112,18 @@ minetest.register_node("shop:shop", {
return
end
local err = "";
if not inv:contains_item("stock", s[1]) and meta:get_int("admin_shop")~=1 then
if not inv:contains_item("stock", s[1]) then
err = "Error. Shop out of stock.";
meta:set_string("infotext", err);
end
if not inv:room_for_item("register", b[1]) and meta:get_int("admin_shop")~=1 then
if not inv:room_for_item("register", b[1]) then
err = "Error. Shop register full.";
meta:set_string("infotext", err);
end
end
if not pinv:room_for_item("main", s[1]) then
err = "Error. You dont have space in your inventory.";
end