Skip to content

Commit

Permalink
Removed Unnecessary Null Check.
Browse files Browse the repository at this point in the history
  • Loading branch information
CalebSerafin committed Jun 20, 2020
1 parent 549fcd2 commit f8aaf13
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Antistasi Dev Deploy Shared/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("4.2.5.0")]
[assembly: AssemblyVersion("4.2.6.0")]
[assembly: NeutralResourcesLanguage("en-ZA")]
23 changes: 11 additions & 12 deletions Antistasi Dev Deploy/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,29 +97,27 @@ static void Main(string[] args) {
bool OpenOutput = BoolBin((int)FetchA3DD(Reg.Value_ADD_ForceOpenOutput, 0));
Registry.SetValue(Reg.Key_A3DD_ADD, Reg.Value_ADD_LastPath, System.Reflection.Assembly.GetEntryAssembly().Location, RegistryValueKind.String);

string OverrideSourceFolder = (string)Registry.GetValue(Reg.Key_A3DD_ADD, Reg.Value_ADD_OverrideSourceFolder, "C:\\");
if (OverrideSourceFolder == null) OverrideSourceFolder = "C:\\";
string OverrideSourceFolder = (string)FetchA3DD(Reg.Value_ADD_OverrideSourceFolder, "C:\\");
if (!OverrideSourceFolder.EndsWith("\\")) OverrideSourceFolder += "\\";

string OverrideOutputFolder = (string)Registry.GetValue(Reg.Key_A3DD_ADD, Reg.Value_ADD_OverrideOutputFolder, "C:\\");
if (OverrideOutputFolder == null) OverrideOutputFolder = "C:\\";
string OverrideOutputFolder = (string)FetchA3DD(Reg.Value_ADD_OverrideOutputFolder, "C:\\");
if (!OverrideOutputFolder.EndsWith("\\")) OverrideOutputFolder += "\\";

string CurrentDirectory = Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location);
string SourceDirectory = CurrentDirectory;
if (OverrideSource) {
CurrentDirectory = OverrideSourceFolder;
}
//The following handles whether the executable is placed inside a sub folder in the root git directory.
if (!Directory.Exists(CurrentDirectory + @"\A3-Antistasi")) {
SourceDirectory += @"\..";
}
string Dir_AntistasiRoot = CurrentDirectory + @"\A3-Antistasi";
string Dir_AntistasiTemplates = CurrentDirectory + @"\Map-Templates";
string Dir_mpMissions = Environment.ExpandEnvironmentVariables(@"%USERPROFILE%\Documents\Arma 3 - Other Profiles\" + PlayerName + @"\mpmissions\");
if (!Directory.Exists(Dir_AntistasiRoot)) { ShowMessage(@"ERROR: '\A3-Antistasi' not found."); return; };
if (!Directory.Exists(Dir_AntistasiRoot)) { ShowMessage(@"ERROR: '\Map-Templates' not found."); return; };

//The following handles whether the executable is placed inside a sub folder in the root git directory.
if (!Directory.Exists(Dir_AntistasiRoot)) {
Dir_AntistasiRoot = CurrentDirectory + @"\..\A3-Antistasi";
Dir_AntistasiTemplates = CurrentDirectory + @"\..\Map-Templates";
if (!Directory.Exists(Dir_AntistasiRoot)) { ShowMessage(@"ERROR: '\A3-Antistasi' not found."); return; };
if (!Directory.Exists(Dir_AntistasiRoot)) { ShowMessage(@"ERROR: '\Map-Templates' not found."); return; };
}
string Dir_mpMissions = Environment.ExpandEnvironmentVariables(@"%USERPROFILE%\Documents\Arma 3 - Other Profiles\" + PlayerName + @"\mpmissions\");
/*if there is an issue fetching Arma 3 profile name or if developing on a computer that
does not have Arma 3 Installed this allows it to still be able to package missions.
The name matches the out folder of a python tool in the Official Repository that does this as well.*/
Expand Down Expand Up @@ -150,6 +148,7 @@ The name matches the out folder of a python tool in the Official Repository that
}
Console.WriteLine(string.Join(Environment.NewLine, TemplateNamesDebug.ToArray()));
Console.WriteLine(string.Join(Environment.NewLine,
SourceDirectory,
CurrentDirectory,
GetFolder(CurrentDirectory),
Dir_AntistasiTemplates,
Expand Down

0 comments on commit f8aaf13

Please sign in to comment.