esp: fix crash when no list is defined

wsc-master
cora 2021-07-27 22:18:05 +02:00
parent fbdd177619
commit 52a8195019
1 changed files with 2 additions and 1 deletions

View File

@ -9,7 +9,7 @@ local esplimit=30; -- display at most this many waypoints
local espinterval=4 --number of seconds to wait between scans (a lower number can induce clientside lag)
local stpos={x=0,y=0,z=0}
nodes=nlist.get("esp")
local nodes=nlist.get("esp")
local esp_wps={}
local hud2=nil
@ -18,6 +18,7 @@ local lastch=0
local wason=false
minetest.register_globalstep(function()
if not nodes then return end
if not minetest.settings:get_bool("espactive") then
if #esp_wps > 0 then
for k,v in pairs(esp_wps) do