master
parent
9e107c4b90
commit
0dff5a343d
10
init.lua
10
init.lua
|
@ -102,6 +102,9 @@ minetest.register_node("shop:shop", {
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local err = "";
|
||||||
|
if meta:get_int("admin_shop")~=1 then -- check shop
|
||||||
|
|
||||||
if inv:is_empty("sell") or
|
if inv:is_empty("sell") or
|
||||||
inv:is_empty("buy") or
|
inv:is_empty("buy") or
|
||||||
(not inv:room_for_item("register", b[1])) then
|
(not inv:room_for_item("register", b[1])) then
|
||||||
|
@ -109,17 +112,18 @@ minetest.register_node("shop:shop", {
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local err = "";
|
if not inv:contains_item("stock", s[1]) then
|
||||||
if not inv:contains_item("stock", s[1]) and meta:get_int("admin_shop")~=1 then
|
|
||||||
err = "Error. Shop out of stock.";
|
err = "Error. Shop out of stock.";
|
||||||
meta:set_string("infotext", err);
|
meta:set_string("infotext", err);
|
||||||
end
|
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.";
|
err = "Error. Shop register full.";
|
||||||
meta:set_string("infotext", err);
|
meta:set_string("infotext", err);
|
||||||
end
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
if not pinv:room_for_item("main", s[1]) then
|
if not pinv:room_for_item("main", s[1]) then
|
||||||
err = "Error. You dont have space in your inventory.";
|
err = "Error. You dont have space in your inventory.";
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue