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

Bug on wavform #49

Closed
luca2125 opened this issue Mar 6, 2021 · 2 comments
Closed

Bug on wavform #49

luca2125 opened this issue Mar 6, 2021 · 2 comments

Comments

@luca2125
Copy link

luca2125 commented Mar 6, 2021

Hi Mike,

There is a bug on wav form that crash if the mission or battle is > 9:

			_frontend = _wave + "FrontEnd\\" + Path.GetFileNameWithoutExtension(_mission.MissionFileName).Substring(1).Remove(4) + "\\";
			_battleNumber = int.Parse(Directory.GetParent(_frontend).Name.Substring(1, 1));
			_missionNumber = int.Parse(Directory.GetParent(_frontend).Name.Substring(3, 1));

You work on fixed chars: Remove(4) and when you convert to int if the mission is > 9 you get a letter and this cause exception.

So if you do something like this for example::

FileNoChars = Path.GetFileNameWithoutExtension(_mission.MissionFileName).Replace("B", " ").Replace("M"," ");

_battleNumber =FileNoChars.Split(FileNoChars, " ")[1];
_missionNumber =FileNoChars.Split(FileNoChars, " ")[2];

This is only a pseudo code to explain the concept.

Hope this help.

@MikeG621
Copy link
Owner

MikeG621 commented Mar 6, 2021 via email

MikeG621 added a commit that referenced this issue Mar 6, 2021
@MikeG621
Copy link
Owner

Fixed in v1.9.2

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

No branches or pull requests

2 participants