Skip to content

Commit

Permalink
6.5 dat fix (#162)
Browse files Browse the repository at this point in the history
closes #161
  • Loading branch information
slotthhy authored Oct 3, 2023
1 parent 39c47f6 commit 051e78a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion SaintCoinach/IO/IIndexFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace SaintCoinach.IO {
public interface IIndexFile : IEquatable<IIndexFile> {
PackIdentifier PackId { get; }
uint FileKey { get; }
int Offset { get; }
uint Offset { get; }
byte DatFile { get; }
}
}
4 changes: 2 additions & 2 deletions SaintCoinach/IO/Index2File.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class Index2File : IIndexFile {

public PackIdentifier PackId { get; private set; }
public uint FileKey { get; private set; }
public int Offset { get; private set; }
public uint Offset { get; private set; }

/// <summary>
/// In which .dat* file the data is located.
Expand All @@ -28,7 +28,7 @@ public Index2File(PackIdentifier packId, BinaryReader reader) {

var baseOffset = reader.ReadInt32();
DatFile = (byte)((baseOffset & 0x7) >> 1);
Offset = (int)((baseOffset & 0xFFFFFFF8) << 3);
Offset = (uint)((baseOffset & 0xFFFFFFF8) << 3);
}

#endregion
Expand Down
4 changes: 2 additions & 2 deletions SaintCoinach/IO/IndexFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class IndexFile : IIndexFile {
public PackIdentifier PackId { get; private set; }
public uint FileKey { get; private set; }
public uint DirectoryKey { get; private set; }
public int Offset { get; private set; }
public uint Offset { get; private set; }

/// <summary>
/// In which .dat* file the data is located.
Expand All @@ -28,7 +28,7 @@ public IndexFile(PackIdentifier packId, BinaryReader reader) {

var baseOffset = reader.ReadInt32();
DatFile = (byte)((baseOffset & 0x000F) / 2);
Offset = (baseOffset - (baseOffset & 0x000F)) * 0x08;
Offset = (uint)(baseOffset - (baseOffset & 0x000F)) * 0x08;

reader.ReadInt32(); // Zero
}
Expand Down

0 comments on commit 051e78a

Please sign in to comment.