Skip to content

Commit

Permalink
allow integration w/o uexp but good luck with that
Browse files Browse the repository at this point in the history
  • Loading branch information
atenfyr committed Apr 15, 2022
1 parent 720343f commit b0ddd38
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions LevelBaker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ public UAsset Bake(string[] newComponents, string[] newTrailheads, byte[] superR
// First we see if we can find the actual asset it's referring to
List<SCS_Node> allBlueprintCreatedComponents = new List<SCS_Node>();
byte[] foundData1 = ParentIntegrator.SearchInAllPaksForPath(componentPath.ConvertGamePathToAbsolutePath(), Extractor);
byte[] foundData2 = ParentIntegrator.SearchInAllPaksForPath(Path.ChangeExtension(componentPath.ConvertGamePathToAbsolutePath(), ".uexp"), Extractor);
byte[] foundData = null; if (foundData1 != null && foundData2 != null) foundData = IntegratorUtils.Concatenate(foundData1, foundData2);
byte[] foundData2 = ParentIntegrator.SearchInAllPaksForPath(Path.ChangeExtension(componentPath.ConvertGamePathToAbsolutePath(), ".uexp"), Extractor) ?? new byte[0];
byte[] foundData = null; if (foundData1 != null) foundData = IntegratorUtils.Concatenate(foundData1, foundData2);
if (foundData != null && foundData.Length > 0)
{
// If we can find the asset, then we read the asset and hop straight to the SimpleConstructionScript
Expand Down
12 changes: 6 additions & 6 deletions ModIntegrator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ public void IntegrateMods(string paksPath, string installPath) // @"C:\Users\<CL
foreach (string mapPath in MapPaths)
{
byte[] mapPathData1 = FindFile(mapPath, ourExtractor);
byte[] mapPathData2 = FindFile(Path.ChangeExtension(mapPath, ".uexp"), ourExtractor);
if (mapPathData1 != null && mapPathData2 != null) IntegratorUtils.SplitExportFiles(levelBaker.Bake(newPersistentActors.ToArray(), newTrailheads.ToArray(), IntegratorUtils.Concatenate(mapPathData1, mapPathData2)), mapPath, CreatedPakData);
byte[] mapPathData2 = FindFile(Path.ChangeExtension(mapPath, ".uexp"), ourExtractor) ?? new byte[0];
if (mapPathData1 != null) IntegratorUtils.SplitExportFiles(levelBaker.Bake(newPersistentActors.ToArray(), newTrailheads.ToArray(), IntegratorUtils.Concatenate(mapPathData1, mapPathData2)), mapPath, CreatedPakData);
}
}

Expand All @@ -245,8 +245,8 @@ public void IntegrateMods(string paksPath, string installPath) // @"C:\Users\<CL
string establishedPath = entry.Key.ConvertGamePathToAbsolutePath();

byte[] actorData1 = FindFile(establishedPath, ourExtractor);
byte[] actorData2 = FindFile(Path.ChangeExtension(establishedPath, ".uexp"), ourExtractor);
if (actorData1 == null || actorData2 == null) continue;
byte[] actorData2 = FindFile(Path.ChangeExtension(establishedPath, ".uexp"), ourExtractor) ?? new byte[0];
if (actorData1 == null) continue;
try
{
IntegratorUtils.SplitExportFiles(actorBaker.Bake(entry.Value.ToArray(), IntegratorUtils.Concatenate(actorData1, actorData2)), establishedPath, CreatedPakData);
Expand All @@ -263,8 +263,8 @@ public void IntegrateMods(string paksPath, string installPath) // @"C:\Users\<CL
string establishedPath = entry.Key.ConvertGamePathToAbsolutePath();

byte[] actorData1 = FindFile(establishedPath, ourExtractor);
byte[] actorData2 = FindFile(Path.ChangeExtension(establishedPath, ".uexp"), ourExtractor);
if (actorData1 == null || actorData2 == null) continue;
byte[] actorData2 = FindFile(Path.ChangeExtension(establishedPath, ".uexp"), ourExtractor) ?? new byte[0];
if (actorData1 == null) continue;
try
{
IntegratorUtils.SplitExportFiles(itemListBaker.Bake(entry.Value, IntegratorUtils.Concatenate(actorData1, actorData2)), establishedPath, CreatedPakData);
Expand Down

0 comments on commit b0ddd38

Please sign in to comment.