nil check

This commit is contained in:
TenPlus1 2018-06-19 18:42:13 +01:00
parent 1018a558d2
commit 10abb996c1
4 changed files with 4 additions and 4 deletions

View File

@ -32,7 +32,7 @@ local function place_beans(itemstack, placer, pointed_thing, plantname)
end
-- is player planting crop?
local name = placer:get_player_name() or ""
local name = placer and placer:get_player_name() or ""
-- check for protection
if minetest.is_protected(pt.under, name) then

View File

@ -32,7 +32,7 @@ local function place_cocoa(itemstack, placer, pointed_thing, plantname)
end
-- is player planting crop?
local name = placer:get_player_name() or ""
local name = placer and placer:get_player_name() or ""
-- check for protection
if minetest.is_protected(pt.above, name) then

View File

@ -27,7 +27,7 @@ local function place_grapes(itemstack, placer, pointed_thing, plantname)
end
-- is player planting seed?
local name = placer:get_player_name() or ""
local name = placer and placer:get_player_name() or ""
-- check for protection
if minetest.is_protected(pt.under, name) then

View File

@ -445,7 +445,7 @@ function farming.place_seed(itemstack, placer, pointed_thing, plantname)
end
-- is player planting seed?
local name = placer:get_player_name() or ""
local name = placer and placer:get_player_name() or ""
-- if not protected then add node and remove 1 item from the itemstack
if not minetest.is_protected(pt.above, name) then