Merge branch 'master' into 'master'

Fix robot being able to take pipeworks virtual item.

See merge request Illuna-Minetest/basic_robot!1
master
Milan 2020-04-13 16:19:14 +02:00
commit 304f55fe83
2 changed files with 16 additions and 7 deletions

View File

@ -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);

View File

@ -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.")
print('[MOD]'.. " basic_robot " .. basic_robot.version .. " loaded.")