Skip to content
Snippets Groups Projects
Commit 304f55fe authored by Milan's avatar Milan
Browse files

Merge branch 'master' into 'master'

Fix robot being able to take pipeworks virtual item.

See merge request !1
parents fd136303 51fccf04
No related branches found
No related tags found
1 merge request!1Fix robot being able to take pipeworks virtual item.
......@@ -222,7 +222,12 @@ basic_robot.commands.take_item = function(name,item, inventory,dir)
local pos = basic_robot.data[name].spawnpos; -- position of spawner block
if basic_robot.bad_inventory_blocks[ minetest.get_node(tpos).name ] then return false end -- dont allow take from
for i, bad_inventory in pairs(basic_robot.bad_inventory_blocks) do -- dont allow take from
if minetest.get_node(tpos).name:find("^" .. bad_inventory) ~= nil then
return false
end
end
local meta = minetest.get_meta(pos);
local tmeta = minetest.get_meta(tpos);
......
......@@ -15,11 +15,15 @@ basic_robot.maxoperations = 10; -- how many operations (dig, place,move,...,gene
basic_robot.dig_require_energy = true; -- does robot require energy to dig stone?
basic_robot.bad_inventory_blocks = { -- disallow taking from these nodes inventories to prevent player abuses
["craft_guide:sign_wall"] = true,
["basic_machines:battery_0"] = true,
["basic_machines:battery_1"] = true,
["basic_machines:battery_2"] = true,
["basic_machines:generator"] = true,
"craft_guide:sign_wall",
"basic_machines:battery_0",
"basic_machines:battery_1",
"basic_machines:battery_2",
"basic_machines:generator",
"pipeworks:autocrafter",
"pipeworks:mese_filter",
"pipeworks:filter",
"pipeworks:mese_tube_", -- matched to first part of node name
}
----- END OF SETTINGS ------
......@@ -1904,4 +1908,4 @@ minetest.register_craft({
minetest.register_privilege("robot", "increased number of allowed active robots")
minetest.register_privilege("puzzle", "allow player to use puzzle. namespace in robots")
print('[MOD]'.. " basic_robot " .. basic_robot.version .. " loaded.")
\ No newline at end of file
print('[MOD]'.. " basic_robot " .. basic_robot.version .. " loaded.")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment