autoaim: fix crash on login

This commit is contained in:
cora 2021-07-15 22:36:04 +02:00 committed by Schmappie Eldress
parent 1912e3302e
commit c380ab95b6

View File

@ -1,4 +1,5 @@
local function look_nearest()
if not minetest.localplayer then return end
for k, v in ipairs(minetest.localplayer.get_nearby_objects(10)) do
if (v:is_player() and v:get_name() ~= minetest.localplayer:get_name()) then
local pos = v:get_pos()