Skip to content

Commit

Permalink
Fixed for update
Browse files Browse the repository at this point in the history
  • Loading branch information
MontagueM committed Dec 10, 2022
1 parent b8e2923 commit 5086017
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 24 deletions.
19 changes: 11 additions & 8 deletions Charm/ActivityMapView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,17 @@ private ObservableCollection<DisplayBubble> GetMapList(Activity activity)
var maps = new ObservableCollection<DisplayBubble>();
foreach (var mapEntry in activity.Header.Unk50)
{
// idk why this can happen but it can, some weird stuff with h64
// for the child map reference, ive only seen it once so far but the hash for it was just FFFFFFFF in the map reference file
if (mapEntry.MapReference is null || mapEntry.MapReference.Header.ChildMapReference == null)
continue;
DisplayBubble displayMap = new DisplayBubble();
displayMap.Name = $"{mapEntry.BubbleName} ({mapEntry.Unk10.BubbleName})"; // assuming Unk10 is 0F978080 or 0B978080
displayMap.Hash = mapEntry.MapReference.Header.ChildMapReference.Hash;
maps.Add(displayMap);
foreach (var mapReferences in mapEntry.MapReferences)
{
// idk why this can happen but it can, some weird stuff with h64
// for the child map reference, ive only seen it once so far but the hash for it was just FFFFFFFF in the map reference file
if (mapReferences.MapReference is null || mapReferences.MapReference.Header.ChildMapReference == null)
continue;
DisplayBubble displayMap = new DisplayBubble();
displayMap.Name = $"{mapEntry.BubbleName} ({mapEntry.LocationName})"; // assuming Unk10 is 0F978080 or 0B978080
displayMap.Hash = mapReferences.MapReference.Header.ChildMapReference.Hash;
maps.Add(displayMap);
}
}
return maps;
}
Expand Down
16 changes: 15 additions & 1 deletion Charm/DevView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Text.RegularExpressions;
using System.Windows;
Expand Down Expand Up @@ -49,7 +50,20 @@ private void TagHashBoxKeydown(object sender, KeyEventArgs e)
TagHashBox.Text = "INVALID HASH";
return;
}
TagHash hash = new TagHash(strHash);

TagHash hash;
if (strHash.Contains("-"))
{
var s = strHash.Split("-");
var pkgid = Int32.Parse(s[0], NumberStyles.HexNumber);
var entryindex = Int32.Parse(s[1], NumberStyles.HexNumber);
hash = new TagHash(PackageHandler.MakeHash(pkgid, entryindex));
}
else
{
hash = new TagHash(strHash);
}

if (!hash.IsValid())
{
TagHashBox.Text = "INVALID HASH";
Expand Down
47 changes: 35 additions & 12 deletions Field/General/Activity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ public struct D2Class_8B8E8080
public List<D2Class_2E898080> Activities;
}

[StructLayout(LayoutKind.Sequential, Size = 4)]
public struct D2Class_DE448080
{
[DestinyField(FieldType.TagHash)]
public Tag Unk00;
}

[StructLayout(LayoutKind.Sequential, Size = 0x18)]
public struct D2Class_2E898080
{
Expand All @@ -78,7 +85,7 @@ public struct D2Class_2E898080
public string ActivityName;
}

[StructLayout(LayoutKind.Sequential, Size = 0x90)]
[StructLayout(LayoutKind.Sequential, Size = 0x58)]
public struct D2Class_26898080
{
public DestinyHash LocationName;
Expand All @@ -94,16 +101,8 @@ public struct D2Class_26898080
public DestinyHash Unk28;
[DestinyOffset(0x30)]
public int Unk30;
[DestinyOffset(0x48)]
public DestinyHash Unk48;
[DestinyOffset(0x50)]
public DestinyHash Unk50;
public DestinyHash Unk54;
public DestinyHash Unk58;
[DestinyOffset(0x6A)]
public short Unk6A;
[DestinyOffset(0x70), DestinyField(FieldType.TablePointer)]
public List<D2Class_48898080> Unk70;
[DestinyOffset(0x38), DestinyField(FieldType.TablePointer)]
public List<D2Class_48898080> Unk38;
}

[StructLayout(LayoutKind.Sequential, Size = 0x18)]
Expand Down Expand Up @@ -246,14 +245,38 @@ public struct D2Class_24898080
public DestinyHash ActivityName;
public DestinyHash BubbleName;
[DestinyOffset(0x10), DestinyField(FieldType.ResourcePointer)]
public dynamic? Unk10; // 0F978080
public dynamic? Unk10; // 0F978080, 53418080
[DestinyField(FieldType.TablePointer)]
public List<D2Class_48898080> Unk18;
[DestinyField(FieldType.TablePointer)]
public List<D2Class_1D898080> MapReferences;
}

[StructLayout(LayoutKind.Sequential, Size = 0x10)]
public struct D2Class_1D898080
{
[DestinyField(FieldType.TagHash64)]
public Tag<D2Class_1E898080> MapReference;
}

[StructLayout(LayoutKind.Sequential, Size = 0x20)]
public struct D2Class_53418080
{
public DestinyHash Unk00;
public DestinyHash Unk04;
[DestinyOffset(0xC)]
public int Unk0C;
}

[StructLayout(LayoutKind.Sequential, Size = 0x40)]
public struct D2Class_54418080
{
public DestinyHash Unk00;
public DestinyHash Unk04;
[DestinyOffset(0xC)]
public int Unk0C;
}

[StructLayout(LayoutKind.Sequential, Size = 0x40)]
public struct D2Class_0F978080
{
Expand Down
10 changes: 7 additions & 3 deletions Field/General/General.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public DestinyHash(string hash, bool bBigEndianString = false)
bool parsed = uint.TryParse(hash, NumberStyles.HexNumber, null, out Hash);
if (parsed)
{
if (hash.EndsWith("80") || bBigEndianString)
if (hash.EndsWith("80") || hash.EndsWith("81") || bBigEndianString)
{
Hash = Endian.SwapU32(Hash);
}
Expand Down Expand Up @@ -108,7 +108,11 @@ public virtual bool IsValid()

public int GetPkgId()
{
return (int)((Hash >> 0xD) & 0x3ff);
if ((Hash & 0x01_00_00_00) != 0)
{
return (int) ((Hash >> 0xD) & 0x3FF) | 0x400;
}
return (int) ((Hash >> 0xD) & 0x3FF);
}

public int GetEntryIndex()
Expand Down Expand Up @@ -215,7 +219,7 @@ public TagHash(ulong hash) : base(TagHash64Handler.GetTagHash64(hash))

public override bool IsValid()
{
if (Hash < 0x80a00000 || Hash > 0x80ffffff)
if (Hash < 0x80a00000 || Hash > 0x81ffffff)
{
return false;
}
Expand Down
Binary file modified ThirdParty/Symmetry.dll
Binary file not shown.

0 comments on commit 5086017

Please sign in to comment.