Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Lander: fine tuning coords causes red (invalid numbers) to appear in the Lat box. #62
I've confirmed this as follows.
While at the KSC Launch Pad (and likely other places), if the Lat (North/South) coords are adjusted with I and K (and NOT the Lon East/West with J and L) to a negative number (Southern hemisphere), that is when the problem occurs.
The LAT entry changes to -359.xxx and turns red since that value is not valid (technically). The game seems to like those values just fine, and the Lander appears to still work mostly, but the Land/Drop button isn't available, nor is the Save button.
In the past, I added code to turn the LAT entry red if the value is outside of -89.9 to +89.9, because that is the reality of navigating a spheroid body. I think the reason the -359.xxx entries still work (sorta) is because the game is just wrapping around the body (dividing the value by 360). I believe the game doesn't care for anything exactly at 90 North or South, so that's why I added the limits.
We should probably change the limit to finer divisions, such as 89.999, as well as auto-correcting the numbers instead of just complaining. This may be simple enough for me to do, but I'll have to take a long look at the code again, and I would not refuse some C# help here.
EDIT: Sorry for all the tiny edits!
TL DR :
Long version :
If I go through the function with a negative latitude value of -1 it goes like this :
So if the latitude is negative the return value for display is always going to be out of boundaries.