Skip to content

Commit

Permalink
Fix issues pointed out in code review.
Browse files Browse the repository at this point in the history
  • Loading branch information
num0005 committed Oct 22, 2021
1 parent 39021f1 commit c6ea3f2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Launcher/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ private async void CompileLevel(string level_path, string bsp_path, string Level
var info = ToolkitBase.SplitStructureFilename(level_path, bsp_path);
var scen_path = Path.Combine(info.ScenarioPath, info.ScenarioName);
CancelableProgressBarWindow<int> progress = null;
if (halo_3 || (halo_2_mcc && lightmaps_args.instanceCount > 1) || (halo_2_standalone_community && lightmaps_args.instanceCount > 1))
if (halo_3 || ((halo_2_mcc || halo_2_standalone_community) && lightmaps_args.instanceCount > 1))
progress = new CancelableProgressBarWindow<int>();
try
{
Expand Down
6 changes: 4 additions & 2 deletions Launcher/ToolkitInterface/H2Toolkit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using static ToolkitLauncher.ToolkitProfiles;
using System.IO;
using System.Threading;
using System.Diagnostics;

namespace ToolkitLauncher.ToolkitInterface
{
Expand Down Expand Up @@ -59,7 +60,7 @@ public override async Task BuildLightmap(string scenario, string bsp, LightmapAr
{
string quality = GetLightmapQuality(args);

if ((args.instanceCount > 1 && Profile.IsMCC) || (args.instanceCount > 1 && Profile.CommunityTools))
if (args.instanceCount > 1 && (Profile.IsMCC || Profile.CommunityTools)) // multi instance?
{
if (progress is not null)
progress.MaxValue += 1 + args.instanceCount;
Expand All @@ -68,7 +69,7 @@ async Task RunInstance(int index)
{
if (index == 0 && !Profile.IsH2Codez()) // not needed for H2Codez
{
if (progress is not null && args.instanceCount > 1)
if (progress is not null)
progress.Status = "Delaying launch of zeroth instance";
await Task.Delay(1000 * 70, progress.GetCancellationToken());
}
Expand Down Expand Up @@ -105,6 +106,7 @@ async Task RunInstance(int index)
}
else
{
Debug.Assert(args.instanceCount == 1); // should be one, otherwise we got bad args
if (progress is not null)
{
progress.DisableCancellation();
Expand Down

0 comments on commit c6ea3f2

Please sign in to comment.