[FIXED][1297.1] Tool_Range throws an error when one of the points is at Null Island (0 lat, 0 lon)

Post bug reports and ask for game support here.

Moderator: MOD_Command

Post Reply
wirthlin
Posts: 22
Joined: Sat Dec 26, 2020 11:22 pm

[FIXED][1297.1] Tool_Range throws an error when one of the points is at Null Island (0 lat, 0 lon)

Post by wirthlin »

Tool_Range throws the error "Tool_Range 0 : ,No points have been set" when one or both of the points is at 0 degrees latitude and 0 degrees longitude. Tool_Bearing works fine. Below is some sample LUA code that demonstrates the problem. A workaround is to use some non-zero latitude or longitude (such as 0.0000000000001) instead of 0.

Code: Select all

local p1 = {latitude = 0, longitude = 0}
local p2 = {latitude = 0, longitude = 45}

local bear = Tool_Bearing(p1, p2)
print("Bearing: " .. bear)
local dist = Tool_Range(p1, p2)
print("Distance: " .. dist)
User avatar
michaelm75au
Posts: 12457
Joined: Sat May 05, 2001 8:00 am
Location: Melbourne, Australia

Re: [1297.1] Tool_Range throws an error when one of the points is at Null Island (0 lat, 0 lon)

Post by michaelm75au »

Fixed for next build
Michael
wirthlin
Posts: 22
Joined: Sat Dec 26, 2020 11:22 pm

Re: [1297.1] Tool_Range throws an error when one of the points is at Null Island (0 lat, 0 lon)

Post by wirthlin »

michaelm75au wrote: Fri Dec 02, 2022 9:53 am Fixed for next build
Thank you very much Michael! You guys are all amazing.

Ralph
Post Reply

Return to “Tech Support”