mirror of
https://github.com/minetest-mods/MoreMesecons.git
synced 2025-06-30 15:30:28 +02:00
Check for NaN values in settings
This commit is contained in:
@ -13,10 +13,14 @@ local teleport_nearest = function(pos)
|
||||
local MAX_TELEPORTATION_DISTANCE = tonumber(minetest.setting_get("moremesecons_teleporter.max_t2t_distance")) or 50
|
||||
if MAX_TELEPORTATION_DISTANCE <= 0 then
|
||||
MAX_TELEPORTATION_DISTANCE = 1
|
||||
elseif MAX_TELEPORTATION_DISTANCE ~= MAX_TELEPORTATION_DISTANCE then -- NaN
|
||||
MAX_TELEPORTATION_DISTANCE = 50
|
||||
end
|
||||
local MAX_PLAYER_DISTANCE = tonumber(minetest.setting_get("moremesecons_teleporter.max_p2t_distance")) or 25
|
||||
if MAX_PLAYER_DISTANCE <= 0 then
|
||||
MAX_PLAYER_DISTANCE = 1
|
||||
elseif MAX_PLAYER_DISTANCE ~= MAX_PLAYER_DISTANCE then -- NaN
|
||||
MAX_PLAYER_DISTANCE = 25
|
||||
end
|
||||
|
||||
-- Search the nearest player
|
||||
|
Reference in New Issue
Block a user