🐛 Fix warp list crashing if no warp found

This commit is contained in:
oof2win2
2021-09-26 19:33:44 +00:00
parent 8108bd1127
commit 8b76fa245f

View File

@@ -793,6 +793,7 @@ Event.on_nth_tick(math.floor(60/config.update_smoothing), function()
end end
end end
if closest_warp then
-- Check the dist to the closest warp -- Check the dist to the closest warp
local in_range = closest_warp.warp_id == warp_ids.spawn and closest_distance < rs2 or closest_distance < r2 local in_range = closest_warp.warp_id == warp_ids.spawn and closest_distance < rs2 or closest_distance < r2
if was_in_range and not in_range then if was_in_range and not in_range then
@@ -814,7 +815,7 @@ Event.on_nth_tick(math.floor(60/config.update_smoothing), function()
add_warp_element.enabled = false add_warp_element.enabled = false
add_warp_element.tooltip = {'warp-list.too-close', closest_warp.name} add_warp_element.tooltip = {'warp-list.too-close', closest_warp.name}
end end
end
end end
end end