From ef6d8e7226cd31cab1cd79fd90e38cf1010e2e15 Mon Sep 17 00:00:00 2001 From: MopsieX Date: Mon, 26 Aug 2019 20:59:20 -0400 Subject: [PATCH] fixes crash on Launch button press --- SingleplayerLauncher/Hero.cs | 4 ++-- SingleplayerLauncher/LauncherMainForm.cs | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/SingleplayerLauncher/Hero.cs b/SingleplayerLauncher/Hero.cs index db1e213..59d599e 100644 --- a/SingleplayerLauncher/Hero.cs +++ b/SingleplayerLauncher/Hero.cs @@ -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); @@ -77,7 +77,7 @@ public void ApplyLoadoutChanges() ApplyTrapsGear(); //ApplyGuardians(); //ApplyTraits(); - ApplySkin(); + //ApplySkin(); } private void ApplyTrapsGear() diff --git a/SingleplayerLauncher/LauncherMainForm.cs b/SingleplayerLauncher/LauncherMainForm.cs index 4a6c913..a7f82ec 100644 --- a/SingleplayerLauncher/LauncherMainForm.cs +++ b/SingleplayerLauncher/LauncherMainForm.cs @@ -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();