mirror of
https://github.com/Sokomine/chesttools.git
synced 2025-01-09 17:40:37 +01:00
fixed crash
This commit is contained in:
parent
80d4ce0d84
commit
eefeb09d8a
5
init.lua
5
init.lua
@ -95,11 +95,14 @@ end
|
|||||||
|
|
||||||
|
|
||||||
chesttools.may_use = function( pos, player )
|
chesttools.may_use = function( pos, player )
|
||||||
if( not( player )) then
|
if( not( player ) or not(pos) or not(pos.x)) then
|
||||||
return false;
|
return false;
|
||||||
end
|
end
|
||||||
local name = player:get_player_name();
|
local name = player:get_player_name();
|
||||||
local meta = minetest.get_meta( pos );
|
local meta = minetest.get_meta( pos );
|
||||||
|
if(not(meta)) then
|
||||||
|
return false
|
||||||
|
end
|
||||||
local owner = meta:get_string( 'owner' )
|
local owner = meta:get_string( 'owner' )
|
||||||
-- the owner can access the chest
|
-- the owner can access the chest
|
||||||
if( owner == name or owner == "" ) then
|
if( owner == name or owner == "" ) then
|
||||||
|
Loading…
Reference in New Issue
Block a user