mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
FateTable update for ClientStructs
This commit is contained in:
parent
95eaca1ee8
commit
9f6c8cb9cf
2 changed files with 5 additions and 9 deletions
|
|
@ -131,6 +131,6 @@ namespace Dalamud.Game.ClientState.Fates
|
|||
/// <summary>
|
||||
/// Gets the territory this <see cref="Fate"/> is located in.
|
||||
/// </summary>
|
||||
public ExcelResolver<Lumina.Excel.GeneratedSheets.TerritoryType> TerritoryType => new(this.Struct->TerritoryID);
|
||||
public ExcelResolver<Lumina.Excel.GeneratedSheets.TerritoryType> TerritoryType => new(this.Struct->TerritoryId);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,16 +45,13 @@ namespace Dalamud.Game.ClientState.Fates
|
|||
return 0;
|
||||
|
||||
// Sonar used this to check if the table was safe to read
|
||||
var check = Struct->Unk80.ToInt64();
|
||||
if (check == 0)
|
||||
if (Struct->FateDirector == null)
|
||||
return 0;
|
||||
|
||||
var start = Struct->FirstFatePtr.ToInt64();
|
||||
var end = Struct->LastFatePtr.ToInt64();
|
||||
if (start == 0 || end == 0)
|
||||
if (Struct->Fates.First == null || Struct->Fates.Last == null)
|
||||
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)
|
||||
return IntPtr.Zero;
|
||||
|
||||
var firstFate = this.Struct->FirstFatePtr;
|
||||
return *(IntPtr*)(firstFate + (8 * index));
|
||||
return *(IntPtr*)this.Struct->Fates.Get((ulong)index).Value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue