mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-29 20:16:38 +09:00
🐛 Fix warps on other surfaces
This commit is contained in:
@@ -795,8 +795,7 @@ Event.on_nth_tick(math.floor(60/config.update_smoothing), function()
|
||||
|
||||
|
||||
-- Check the dist to the closest warp
|
||||
local in_range = false
|
||||
if closest_warp then in_range = closest_warp.warp_id == warp_ids.spawn and closest_distance < rs2 or closest_distance < r2 end
|
||||
local in_range = closest_warp and closest_warp.warp_id == warp_ids.spawn and closest_distance and (closest_distance < rs2 or closest_distance < r2) or false
|
||||
if was_in_range and not in_range then
|
||||
PlayerInRange:set(player, nil)
|
||||
elseif not was_in_range and in_range then
|
||||
@@ -808,12 +807,12 @@ Event.on_nth_tick(math.floor(60/config.update_smoothing), function()
|
||||
local add_warp_element = frame.container.header.alignment[add_new_warp.name]
|
||||
local old_closest_warp_name = add_warp_element.tooltip[2] or closest_warp and closest_warp.name
|
||||
local was_able_to_make_warp = add_warp_element.enabled
|
||||
local can_make_warp = closest_distance and closest_distance > mr2 or true
|
||||
log(tostring(can_make_warp) .. " " .. tostring(closest_distance) .. " " .. tostring(mr2) .. " " .. tostring(was_able_to_make_warp))
|
||||
local can_make_warp = closest_distance and closest_distance > mr2
|
||||
if not closest_distance then can_make_warp = true end
|
||||
if can_make_warp and not was_able_to_make_warp then
|
||||
add_warp_element.enabled = true
|
||||
add_warp_element.tooltip = {'warp-list.add-tooltip'}
|
||||
elseif not can_make_warp and was_able_to_make_warp or closest_warp and old_closest_warp_name ~= closest_warp.name then
|
||||
elseif not can_make_warp and was_able_to_make_warp or closest_warp and (old_closest_warp_name ~= closest_warp.name) then
|
||||
add_warp_element.enabled = false
|
||||
add_warp_element.tooltip = {'warp-list.too-close', closest_warp.name}
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user