Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unlimited Restricted Airspace Displayed as FLNaN #756

Closed
Fechulo opened this issue Dec 12, 2016 · 8 comments
Closed

Unlimited Restricted Airspace Displayed as FLNaN #756

Fechulo opened this issue Dec 12, 2016 · 8 comments

Comments

@Fechulo
Copy link
Contributor

Fechulo commented Dec 12, 2016

When the ceiling of restricted airspace is unlimited, it is displayed as FLNaN in the game, instead of UNL. It can be seen at UUDD:
flnan

@n8rzz
Copy link
Contributor

n8rzz commented Dec 12, 2016

@Fechulo @erikquinn That is because it's trying to parse a string 'Unlimited' which is obviously, not a number.

This should, hopefully, be an easy fix. Should it display FL UNL or just UNL?

@n8rzz
Copy link
Contributor

n8rzz commented Dec 12, 2016

never mind, I found it.

n8rzz added a commit to n8rzz/atc that referenced this issue Dec 12, 2016
@n8rzz
Copy link
Contributor

n8rzz commented Dec 12, 2016

@Fechulo is this the first you noticed this issue? From what I can tell, this much have been an issue for quite a while. Oh well, it's going to be addressed for v3.2.0.

@Fechulo
Copy link
Contributor Author

Fechulo commented Dec 13, 2016

@n8rzz I believe it should just display 'UNL'. This was definitely working before v3 but I'm not sure when it stopped working. There's very few airports in the game that have restricted airspace with an unlimited ceiling, so I found it today while working on El Paso Intl.

@n8rzz
Copy link
Contributor

n8rzz commented Dec 13, 2016

@Fechulo right on, I think there were two airports that came up when I searched. I'm sure I got a little jumpy refactoring and something was missed. In fact, thats my assumption here.

Good news is that there are now specific tests for this case, so once the bugfix is completed we will know that this case is covered with tests.

@erikquinn
Copy link
Collaborator

@n8rzz does Infinity parse properly as a number? Perhaps using that in the file instead of unlimited would yield an equally acceptable result without necessitating complications to the logic for this one case? Either way. I do agree with @Fechulo though, definitely UNL of the two or 999 or 600 (the top of controlled airspace is more of less considered to be FL600, where the jet airways are no longer usable).

@n8rzz
Copy link
Contributor

n8rzz commented Dec 13, 2016

@erikquinn parseFloat(Infinity) will output Infinity. The problem here, is that infinity is being passed as a string and not a number (Infinity is a number in javascript):

parseFloat(Infinity) -> Infinity
parseFloat('Infinity') -> NaN

As far the FL and the UNL, that is already implemented within the CanvasController but because the height value is NaN by the time it gets there, the ternary thinks is supposed to be a FL.

const height = (area.height === Infinity ? 'UNL' : 'FL' + Math.ceil(area.height / 1000) * 10);

Dabea pushed a commit to n8rzz/atc that referenced this issue Dec 18, 2016
Dabea added a commit to n8rzz/atc that referenced this issue Dec 18, 2016
@n8rzz n8rzz mentioned this issue Dec 19, 2016
@erikquinn
Copy link
Collaborator

Resolved by #755. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants