Skip to content

Same NPCDialogDifficulty data #3

Description

@Vitalick

idx variable should be declared upper then cycle foreach (var npcDialogSectionProperty in typeof(NPCDialogSection).GetProperties())
In this moment every NPCDialogDifficulty in NPCDialogSection have same data

var skippedProperties = new string[] { "Header", "Length" };
foreach (var npcDialogSectionProperty in typeof(NPCDialogSection).GetProperties())
{
if (skippedProperties.Contains(npcDialogSectionProperty.Name)) continue;
NPCDialogDifficulty npcDialogDifficulty = new NPCDialogDifficulty();
int idx = 0;
foreach (var property in typeof(NPCDialogDifficulty).GetProperties())
{
NPCDialogData data = new NPCDialogData();
data.Introduction = bits[idx];
data.Congratulations = bits[idx + (0x18 * 8)];
idx++;
property.SetValue(npcDialogDifficulty, data);
}
npcDialogSectionProperty.SetValue(npcDialogSection, npcDialogDifficulty);
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions