-- end\r
if meta:get_int("ghost") ~=1 then\r
-- transition shops to ghost inventory.\r
- if inv:room_for_item("main", pay) and inv:room_for_item("main", stack) then\r
- meta:set_int("ghost", 1)\r
- inv:add_item("main", pay)\r
- inv:add_item("main", stack)\r
+ for i=1,4 do\r
+ if inv:room_for_item("main", "pay"..i) and inv:room_for_item("main", "give"..i) then\r
+ meta:set_int("ghost", 1)\r
+ inv:add_item("main", inv:get_stack("pay"..i,1))\r
+ inv:add_item("main", inv:get_stack("give"..i,1))\r
+ end\r
end\r
end\r
if type==1 and inv:contains_item("main", stack)==false then\r
local inv = meta:get_inventory()\r
local owner=meta:get_string("owner")\r
local gve=0\r
- if meta:get_int("sellall")==1 then gve=1 end\r
+-- if meta:get_int("sellall")==1 then gve=1 end\r
if meta:get_int("type")==0 then\r
meta:set_string("infotext","(Smartshop by " .. owner ..") Stock is unlimited")\r
return false\r
meta:get_inventory():set_size("pay3", 1)\r
meta:get_inventory():set_size("give4", 1)\r
meta:get_inventory():set_size("pay4", 1)\r
- meta:set_int("ghost", 1)\r
+ meta:set_int("ghost", 0)\r
end,\r
on_rightclick = function(pos, node, player, itemstack, pointed_thing)\r
smartshop.showform(pos,player)\r