Fix protection test

Additionally do a small code change and add a .luacheckrc
This commit is contained in:
HybridDog 2020-10-11 17:14:11 +02:00
parent 705dccfabb
commit 5e5af398c6
2 changed files with 5 additions and 2 deletions

2
.luacheckrc Normal file
View File

@ -0,0 +1,2 @@
read_globals = {"minetest", "vector"}
globals = {"cave_lighting"}

View File

@ -107,7 +107,7 @@ local function search_positions(startpos, maxlight, pname, max_positions)
end
-- Lights up a cave
local function place_torches(pos, maxlight, player)
local function place_torches(startpos, maxlight, player)
-- Get the light_source item
local inv = player:get_inventory()
local wi = player:get_wield_index()
@ -131,7 +131,8 @@ local function place_torches(pos, maxlight, player)
return false, "You need a node emitting light (enough light)."
end
-- Get possible positions
local ps = search_positions(pos, maxlight, name, 200^3)
local ps = search_positions(startpos, maxlight, player:get_player_name(),
200^3)
if not ps then
return false, "It doesn't seem to be dark there or the cave is too big."
end