Skip to content

Commit

Permalink
Merge pull request #17 from MopsieX/crash-fix
Browse files Browse the repository at this point in the history
fixes crash on Launch button press
  • Loading branch information
MopsieX authored Aug 27, 2019
2 parents 5ef74de + ef6d8e7 commit d456ea6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions SingleplayerLauncher/Hero.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public static Hero Instance
};
private static readonly byte[] StartHeaderAfterGuardiansMaximillian = new byte[] { };

private void ApplySkin()
public void ApplySkin()
{
int skinIndex = UPKFile.FindBytesKMP(SkinPatternMaximilian, HeroObjectOffsetMaximilian) + SkinPatternMaximilian.Length;
UPKFile.OverrideBytes(Resources.skins[NameMaximilian][skin], skinIndex);
Expand All @@ -77,7 +77,7 @@ public void ApplyLoadoutChanges()
ApplyTrapsGear();
//ApplyGuardians();
//ApplyTraits();
ApplySkin();
//ApplySkin();
}

private void ApplyTrapsGear()
Expand Down
3 changes: 2 additions & 1 deletion SingleplayerLauncher/LauncherMainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,10 @@ private void btnLaunch_Click(object sender, EventArgs e)
UpdateCharacterDataIni();
UpdateDefaultGameIni();
}
if (!comBoxSkin.SelectedItem.ToString().Equals("") || LoadoutEditorForm.bytes.Count > 0)
if (comBoxSkin.SelectedItem != null || LoadoutEditorForm.bytes.Count > 0)
{
hero.skin = comBoxSkin.SelectedItem.ToString();
hero.ApplySkin();
}

hero.ApplyLoadoutChanges();
Expand Down

0 comments on commit d456ea6

Please sign in to comment.