Skip to content

Commit bf6081b

Browse files
committed
fix weapon skins not being extracted properly
1 parent e338632 commit bf6081b

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

DataTool/SaveLogic/Unlock/SkinTheme.cs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public static void Save(ICLIFlags flags, string directory, STU_63172E83 skin, ST
4343
Save(flags, directory, skinTheme, hero);
4444
}
4545

46-
public static void FindEntities(FindLogic.Combo.ComboInfo info, STUSkinBase skin, STUHero hero) {
46+
public static Dictionary<ulong, ulong> FindEntities(FindLogic.Combo.ComboInfo info, STUSkinBase skin, STUHero hero) {
4747
Dictionary<ulong, ulong> replacements = GetReplacements(skin);
4848

4949
FindLogic.Combo.Find(info, hero.m_gameplayEntity, replacements);
@@ -60,14 +60,16 @@ public static void FindEntities(FindLogic.Combo.ComboInfo info, STUSkinBase skin
6060

6161
FindLogic.Combo.Find(info, hero.m_8125713E, replacements);
6262
info.SetEntityName(hero.m_8125713E, "HighlightIntro");
63+
64+
return replacements;
6365
}
6466

6567
public static void Save(ICLIFlags flags, string directory, STUSkinBase skin, STUHero hero) {
6668
LoudLog("\t\tFinding");
6769

6870
FindLogic.Combo.ComboInfo info = new FindLogic.Combo.ComboInfo();
69-
FindEntities(info, skin, hero);
70-
FindSkinStuff(skin, hero, info);
71+
var replacements = FindEntities(info, skin, hero);
72+
FindSkinStuff(skin, hero, info, replacements);
7173

7274
SaveCore(flags, directory, skin, info);
7375
}
@@ -115,7 +117,7 @@ public static void FindSoundFiles(ICLIFlags flags, string directory, Dictionary<
115117
}
116118
}
117119

118-
private static void FindSkinStuff(STUSkinBase skin, STUHero hero, FindLogic.Combo.ComboInfo info) {
120+
private static void FindSkinStuff(STUSkinBase skin, STUHero hero, FindLogic.Combo.ComboInfo info, Dictionary<ulong, ulong> skinReplacements) {
119121
Dictionary<ulong, ulong> replacements = GetReplacements(skin);
120122

121123
if (skin is STUSkinTheme skinTheme) {
@@ -132,6 +134,12 @@ private static void FindSkinStuff(STUSkinBase skin, STUHero hero, FindLogic.Comb
132134

133135
Dictionary<ulong, ulong> weaponReplacements = GetReplacements(heroWeapon);
134136

137+
foreach (var (key, value) in skinReplacements) {
138+
if (!weaponReplacements.ContainsKey(key)) {
139+
weaponReplacements[key] = value;
140+
}
141+
}
142+
135143
SetPreviewWeaponNames(info, weaponReplacements, hero.m_previewWeaponEntities, index);
136144
SetPreviewWeaponNames(info, weaponReplacements, hero.m_C2FE396F, index);
137145

0 commit comments

Comments
 (0)