Skip to content

Commit

Permalink
Fixed several crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
MontagueM committed Aug 27, 2022
1 parent 7e4cc1b commit a6093db
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Charm/ExportControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public enum EExportTypeFlag
[Description("Terrain only")]
TerrainOnly = 4,
[Description("Pre-arranged map")]
ArrangedMap = 8,
ArrangedMap = 8,
}

public partial class ExportControl : UserControl
Expand Down
2 changes: 1 addition & 1 deletion Charm/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ private void CheckGameVersion()

private async void CheckVersion()
{
var currentVersion = new ApplicationVersion("1.2.1");
var currentVersion = new ApplicationVersion("1.2.2");
var versionChecker = new ApplicationVersionChecker("https://github.com/MontagueM/Charm/raw/main/", currentVersion);
versionChecker.LatestVersionName = "version";
try
Expand Down
3 changes: 2 additions & 1 deletion Charm/MapView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ public void LoadMap(TagHash tagHash, ELOD detailLevel)

private void GetStaticMapData(TagHash tagHash, ELOD detailLevel)
{
StaticMapData staticMapData = PackageHandler.GetTag(typeof(StaticMapData), tagHash);
Tag<D2Class_07878080> tag = PackageHandler.GetTag<D2Class_07878080>(tagHash);
StaticMapData staticMapData = ((D2Class_C96C8080)tag.Header.DataTables[1].DataTable.Header.DataEntries[0].DataResource).StaticMapParent.Header.StaticMap;
SetMapUI(staticMapData, detailLevel);
}

Expand Down
7 changes: 5 additions & 2 deletions Charm/MusicView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,11 @@ public async void Load(TagHash tagHash)
var res = (D2Class_F7458080) resource;
WemsControl.Load(res);
EventsControl.Load(res);
var sbhash = res.AmbientMusicSet.Header.Unk08[0].MusicLoopSound.Header.Unk18.Header.SoundBank.Hash;
SoundbankHash.Text = $"Soundbank: {sbhash} / {sbhash.GetPkgId().ToString("X4")}-{sbhash.GetEntryIndex().ToString("X4")}";
if (res.AmbientMusicSet != null)
{
var sbhash = res.AmbientMusicSet.Header.Unk08[0].MusicLoopSound.Header.Unk18.Header.SoundBank.Hash;
SoundbankHash.Text = $"Soundbank: {sbhash} / {sbhash.GetPkgId().ToString("X4")}-{sbhash.GetEntryIndex().ToString("X4")}";
}
}
else
{
Expand Down
2 changes: 2 additions & 0 deletions Charm/MusicWemsControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ public void Load(D2Class_F5458080 res)

public async void Load(D2Class_F7458080 res)
{
if (res.AmbientMusicSet == null)
return;
// ambient_music_set instead of wwise_loop
MainWindow.Progress.SetProgressStages(res.AmbientMusicSet.Header.Unk08.Select((x,i) => $"Loading ambient music {i+1}/{res.AmbientMusicSet.Header.Unk08.Count}").ToList());

Expand Down
3 changes: 2 additions & 1 deletion Field/General/Activity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -428,14 +428,15 @@ public struct D2Class_318A8080
public int Unk28;
}

[StructLayout(LayoutKind.Sequential, Size = 0x18)]
[StructLayout(LayoutKind.Sequential, Size = 0x20)]
public struct D2Class_FA458080
{
public DestinyHash Unk00;
[DestinyOffset(8), DestinyField(FieldType.RelativePointer)]
public string EventName;

public DestinyHash Unk10; // eventhash? idk
public DestinyHash Unk14;
}

[StructLayout(LayoutKind.Sequential, Size = 0x20)]
Expand Down
2 changes: 1 addition & 1 deletion version.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<Version>
<Id>1.2.1</Id>
<Id>1.2.2</Id>
</Version>

0 comments on commit a6093db

Please sign in to comment.