forked from WolvenKit/WolvenKit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCR2WFile.cs.diff
75 lines (62 loc) · 3.21 KB
/
CR2WFile.cs.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
diff --git a/WolvenKit.CR2W/CR2W/CR2WFile.cs b/WolvenKit.CR2W/CR2W/CR2WFile.cs
index 531e13f8..07f4ed9c 100644
--- a/WolvenKit.CR2W/CR2W/CR2WFile.cs
+++ b/WolvenKit.CR2W/CR2W/CR2WFile.cs
@@ -777,13 +780,11 @@ namespace WolvenKit.CR2W
private (List<string>, List<Tuple<string, string, EImportFlags>>) GenerateStringtableInner()
{
var dbg_trace = new List<string>();
- var newnameslist = new List<string>
- {
- ""
- };
+ var newnameslist = new Dictionary<string, string>();
+ newnameslist.Add("", "");
var newimportslist = new List<Tuple<string,string, EImportFlags>>();
var newsoftlist = new List<Tuple<string,string, EImportFlags>>();
- var guidlist = new List<Guid>();
+ var guidlist = new HashSet<Guid>();
var chunkguidlist = new List<Guid>();
// CDPR changed the type of CPtr<IBehTreeNodeDefinition> RootNode
@@ -798,7 +799,7 @@ namespace WolvenKit.CR2W
newimportslist.AddRange(newsoftlist);
- return (newnameslist, newimportslist);
+ return (newnameslist.Values.ToList(), newimportslist);
void LoopWrapper(Tuple<EStringTableMod, IEditableVariable> var)
{
@@ -813,7 +814,7 @@ namespace WolvenKit.CR2W
if (!skipnamecheck)
{
- if (newnameslist.Last() != StringDictionary.Values.ToList()[newnameslist.Count - 1])
+ if (newnameslist.Last().Value != StringDictionary.Values.ToList()[newnameslist.Count - 1])
{
@@ -1265,18 +1266,18 @@ namespace WolvenKit.CR2W
else
{
- if (!newnameslist.Contains(str))
+ if (!newnameslist.ContainsKey(str))
{
// hack for CApexClothResource *sigh*
if (str == "apexMaterialNames")
{
- if (!newnameslist.Contains("apexBinaryAsset"))
- newnameslist.Add("apexBinaryAsset");
- if (!newnameslist.Contains("array: 95, 0, Uint8"))
- newnameslist.Add("array:95,0,Uint8");
+ if (!newnameslist.ContainsKey("apexBinaryAsset"))
+ newnameslist.Add("apexBinaryAsset", "apexBinaryAsset");
+ if (!newnameslist.ContainsKey("array: 95, 0, Uint8"))
+ newnameslist.Add("array:95,0,Uint8", "array:95,0,Uint8");
}
- newnameslist.Add(str);
+ newnameslist.Add(str, str);
}
}
}
@@ -1406,7 +1407,7 @@ namespace WolvenKit.CR2W
//stream.Seek(m_tableheaders[index].offset, SeekOrigin.Begin);
var hash = new Crc32Algorithm(false);
- var table = stream.ReadStructs<T>(m_tableheaders[index].size, hash);
+ var table = stream.ReadStructs<T>(m_tableheaders[index].itemCount, hash);
return table;
}