forked from mtcontrib/scifi_nodes
add nil-check to door access card check
This commit is contained in:
parent
6fb3ded8ad
commit
e52a890883
@ -33,6 +33,11 @@ function scifi_nodes.door_check_access_card(node_pos, itemstack, player)
|
|||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if not player or not player:is_player() then
|
||||||
|
-- not a player, restrict access
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
local playername = player:get_player_name()
|
local playername = player:get_player_name()
|
||||||
|
|
||||||
if itemstack:get_name() ~= "scifi_nodes:access_card" then
|
if itemstack:get_name() ~= "scifi_nodes:access_card" then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user