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

Fixed exceptions when entering non-numerical waypoints #56

Merged
merged 1 commit into from
Apr 11, 2021

Conversation

RandomStarfighter
Copy link
Contributor

@RandomStarfighter RandomStarfighter commented Mar 31, 2021

Previously, entering non-numerical values into a waypoint grid, or deleting a cell without providing a number, would throw an exception.
This avoids the exception and resets the cell value back to zero if an invalid string is entered.
Note: I noticed that XWA used an additional Math.Round() operation, when the other platforms didn't. I didn't know if there was any reason why, so I kept as is.

EDIT: Only realized after the fact, this doesn't occur in release builds... because of the try/catch... because of course.
Well, at least it won't explode when running in the debugger. I got burned by that issue when editing a test mission, so I was compelled to fix it. Not sure if I should keep this or not.

@MikeG621
Copy link
Owner

Yeah, you must have "always break" turned on. I don't use that feature since there's plenty of "typical" exceptions that get thrown throughout normal operation, so the try/catch handles it, even when I'm running through the debugger.

@RandomStarfighter
Copy link
Contributor Author

A long time ago there were strange issues of release builds throwing exceptions that the debug build wouldn't. So at some point I became more cautious of exceptions, allowing the debugger to catch more of them, so I could fix the code to prevent any exceptions to begin with. But I hadn't changed my exception rules in a while, and it seemed like a sudden new problem that caught me off guard.

@MikeG621 MikeG621 merged commit ffb6d21 into MikeG621:master Apr 11, 2021
@MikeG621
Copy link
Owner

So decided to go ahead and merge this and then I'll remove the try/catch block

MikeG621 added a commit that referenced this pull request Apr 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants