summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Pérez-Cerezo <gabriel@gpcf.eu>2018-01-20 14:49:30 +0100
committerGabriel Pérez-Cerezo <gabriel@gpcf.eu>2018-01-20 14:49:30 +0100
commitcf6ec6dd5aa62d7da48a9e3d0d9aa830856285c0 (patch)
tree0effae33f9d3b1349f08a0cadbc7e380bc075384
parent835571054346bd21f22aa1414be5913aa67a98b0 (diff)
downloadsmartshop-cf6ec6dd5aa62d7da48a9e3d0d9aa830856285c0.tar.gz
smartshop-cf6ec6dd5aa62d7da48a9e3d0d9aa830856285c0.tar.bz2
smartshop-cf6ec6dd5aa62d7da48a9e3d0d9aa830856285c0.zip
Fixed crash when smartshop position unknown
-rw-r--r--init.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/init.lua b/init.lua
index e4d297f..ce6cce0 100644
--- a/init.lua
+++ b/init.lua
@@ -79,6 +79,9 @@ smartshop.receive_fields=function(player,pressed)
if pressed["buy" .. i] then break end
end
local pos=smartshop.user[player:get_player_name()]
+ if not pos then
+ return
+ end
local meta=minetest.get_meta(pos)
local type=meta:get_int("type")
local inv=meta:get_inventory()