master
parent
9e107c4b90
commit
0dff5a343d
32
init.lua
32
init.lua
|
@ -102,22 +102,26 @@ minetest.register_node("shop:shop", {
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if inv:is_empty("sell") or
|
|
||||||
inv:is_empty("buy") or
|
|
||||||
(not inv:room_for_item("register", b[1])) then
|
|
||||||
minetest.chat_send_player(player, "Shop inventory is empty/full.")
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local err = "";
|
local err = "";
|
||||||
if not inv:contains_item("stock", s[1]) and meta:get_int("admin_shop")~=1 then
|
if meta:get_int("admin_shop")~=1 then -- check shop
|
||||||
err = "Error. Shop out of stock.";
|
|
||||||
meta:set_string("infotext", err);
|
if inv:is_empty("sell") or
|
||||||
end
|
inv:is_empty("buy") or
|
||||||
|
(not inv:room_for_item("register", b[1])) then
|
||||||
|
minetest.chat_send_player(player, "Shop inventory is empty/full.")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
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]) then
|
||||||
|
err = "Error. Shop register full.";
|
||||||
|
meta:set_string("infotext", err);
|
||||||
|
end
|
||||||
|
|
||||||
if not inv:room_for_item("register", b[1]) and meta:get_int("admin_shop")~=1 then
|
|
||||||
err = "Error. Shop register full.";
|
|
||||||
meta:set_string("infotext", err);
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if not pinv:room_for_item("main", s[1]) then
|
if not pinv:room_for_item("main", s[1]) then
|
||||||
|
|
Loading…
Reference in New Issue