Merge pull request #688 from goatcorp/endwalker

This commit is contained in:
goaaats 2021-12-03 17:50:04 +01:00 committed by GitHub
commit 4a69b5a6c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 25 deletions

View file

@ -16,7 +16,7 @@
</PropertyGroup> </PropertyGroup>
<PropertyGroup Label="Build"> <PropertyGroup Label="Build">
<OutputPath>$(AppData)\XIVLauncher\devPlugins\Dalamud.CorePlugin</OutputPath> <OutputPath>bin\$(Configuration)</OutputPath>
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>

View file

@ -131,6 +131,6 @@ namespace Dalamud.Game.ClientState.Fates
/// <summary> /// <summary>
/// Gets the territory this <see cref="Fate"/> is located in. /// Gets the territory this <see cref="Fate"/> is located in.
/// </summary> /// </summary>
public ExcelResolver<Lumina.Excel.GeneratedSheets.TerritoryType> TerritoryType => new(this.Struct->TerritoryID); public ExcelResolver<Lumina.Excel.GeneratedSheets.TerritoryType> TerritoryType => new(this.Struct->TerritoryId);
} }
} }

View file

@ -45,16 +45,13 @@ namespace Dalamud.Game.ClientState.Fates
return 0; return 0;
// Sonar used this to check if the table was safe to read // Sonar used this to check if the table was safe to read
var check = Struct->Unk80.ToInt64(); if (Struct->FateDirector == null)
if (check == 0)
return 0; return 0;
var start = Struct->FirstFatePtr.ToInt64(); if (Struct->Fates.First == null || Struct->Fates.Last == null)
var end = Struct->LastFatePtr.ToInt64();
if (start == 0 || end == 0)
return 0; return 0;
return (int)((end - start) / 8); return (int)Struct->Fates.Capacity();
} }
} }
@ -102,8 +99,7 @@ namespace Dalamud.Game.ClientState.Fates
if (fateTable == IntPtr.Zero) if (fateTable == IntPtr.Zero)
return IntPtr.Zero; return IntPtr.Zero;
var firstFate = this.Struct->FirstFatePtr; return *(IntPtr*)this.Struct->Fates.Get((ulong)index).Value;
return *(IntPtr*)(firstFate + (8 * index));
} }
/// <summary> /// <summary>