Skip to content

Commit

Permalink
Merge pull request #421 from erdelf/master
Browse files Browse the repository at this point in the history
DawnIndex fix
  • Loading branch information
Herculezz55 authored Sep 8, 2024
2 parents a98fa6e + 52c2483 commit 102569f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions AutoDuty/Helpers/ContentHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ private static bool TryGetDawnIndex(int indexIn, uint ex, out int indexOut)
return true;
}

private unsafe static int DawnIndex(uint index, uint ex)
private static int DawnIndex(uint index, uint ex)
{
return ex switch
{
Expand All @@ -50,7 +50,7 @@ private static bool TryGetTrustIndex(int indexIn, uint ex, out int indexOut)
return true;
}

private unsafe static int TrustIndex(int index, uint ex)
private static int TrustIndex(int index, uint ex)
{
return ex switch
{
Expand Down Expand Up @@ -91,7 +91,7 @@ static string CleanName(string name)
ExVersion = contentFinderCondition.TerritoryType.Value.ExVersion.Value.RowId,
ClassJobLevelRequired = contentFinderCondition.ClassJobLevelRequired,
ItemLevelRequired = contentFinderCondition.ItemLevelRequired,
DawnIndex = TryGetDawnIndex(listDawnContent.IndexOf(x => x.Content.Value == contentFinderCondition), contentFinderCondition.TerritoryType.Value.ExVersion.Value.RowId, out int dawnIndex) ? dawnIndex : -1,
DawnIndex = TryGetDawnIndex((int)(listDawnContent.FirstOrDefault(x => x.Content.Value?.RowId == contentFinderCondition.RowId)?.RowId ?? 0), contentFinderCondition.TerritoryType.Value.ExVersion.Value.RowId, out int dawnIndex) ? dawnIndex : -1,
TrustIndex = TryGetTrustIndex(listDawnContent.Where(dawnContent => dawnContent.Unknown13).IndexOf(x => x.Content.Value == contentFinderCondition), contentFinderCondition.TerritoryType.Value.ExVersion.Value.RowId, out int trustIndex) ? trustIndex : -1,
VariantContent = ListVVDContent.Any(variantContent => variantContent == contentFinderCondition.TerritoryType.Value.RowId),
VVDIndex = ListVVDContent.FindIndex(variantContent => variantContent == contentFinderCondition.TerritoryType.Value.RowId),
Expand Down Expand Up @@ -131,6 +131,7 @@ static string CleanName(string name)
TrustMemberName.Ryne :
TrustMemberName.Estinien
]);

content.TrustMembers.Add(TrustHelper.Members[TrustMemberName.Graha]);
if (content.TerritoryType is >= 1097 and <= 1164)
content.TrustMembers.Add(TrustHelper.Members[TrustMemberName.Zero]);
Expand Down

0 comments on commit 102569f

Please sign in to comment.