fixed nil crash

master
MisterE123 2021-02-10 12:24:25 -05:00
parent 6d7760d780
commit d64a3dd2e6
1 changed files with 2 additions and 2 deletions

View File

@ -16,7 +16,7 @@ for i = 1, #dyes do
if arena_lib.is_player_in_arena(placer:get_player_name(), "quikbild") then
--minetest.chat_send_all('ln17')
local pos = pointed_thing.above
if minetest.get_node(pos).name == 'air' or string.find(minetest.get_node(pos).name,'quikbild') then
if pos and minetest.get_node(pos).name == 'air' or string.find(minetest.get_node(pos).name,'quikbild') then
--minetest.chat_send_all('ln20')
minetest.set_node(pos, {name="quikbild:" .. name})
@ -32,7 +32,7 @@ for i = 1, #dyes do
on_use = function(itemstack, user, pointed_thing)
if arena_lib.is_player_in_arena(user:get_player_name(), "quikbild") then
local pos = pointed_thing.under
if string.find(minetest.get_node(pos).name,'quikbild') then
if pos and string.find(minetest.get_node(pos).name,'quikbild') then
minetest.set_node(pos, {name="air"})
end