Skip to content

Commit

Permalink
can build archives with missing assets
Browse files Browse the repository at this point in the history
  • Loading branch information
igorseabra4 committed Nov 24, 2018
1 parent cd906cb commit aa94334
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
9 changes: 6 additions & 3 deletions HipHopFile/Functions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -557,17 +557,20 @@ public static HipSection[] SetupStream(ref Section_HIPA HIPA, ref Section_PACK P
// Sort the LDBG asset IDs. The AHDR data will then be written in this order.
LHDR.assetIDlist = LHDR.assetIDlist.OrderBy(i => i).ToList();

foreach (uint assetID in LHDR.assetIDlist)
for (int i = 0; i < LHDR.assetIDlist.Count; i++)
{
Section_AHDR AHDR = assetDictionary[assetID];
Section_AHDR AHDR = assetDictionary[LHDR.assetIDlist[i]];

// Does the AHDR section already have the asset data, or should we get it from the dictionary?
// AHDRs from IP will already have data, but the ones from the INI builder won't!
if (!alreadyHasData)
{
if (!assetDataDictionary.Keys.Contains(AHDR.assetID))
{
SendMessage($"Error: asset with ID [{AHDR.assetID.ToString("X8")}] was not found. The archive will not be saved correctly and will be unusable.");
SendMessage($"Error: asset with ID [{AHDR.assetID.ToString("X8")}] was not found. The asset will be removed from the archive.");
DICT.ATOC.AHDRList.Remove(AHDR);
LHDR.assetIDlist.Remove(AHDR.assetID);
i--;
continue;
}
AHDR.data = assetDataDictionary[AHDR.assetID];
Expand Down
1 change: 0 additions & 1 deletion HipHopFile/Sections/Section_LTOC.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using static HipHopFile.Functions;

namespace HipHopFile
{
Expand Down
2 changes: 1 addition & 1 deletion HipHopTool/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ static void Main(string[] args)
{
System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");

SendMessage("HipHopTool v0.4.8 by igorseabra4");
SendMessage("HipHopTool v0.4.9 by igorseabra4");

if (args.Length == 0)
ShowNoArgsMenu();
Expand Down

0 comments on commit aa94334

Please sign in to comment.