-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash in "hf learns secret"-type events when the teacher ID is not set #18
Comments
Legends-Viewer/LegendsViewer/Legends/Events.cs Line 1234 in a00e70b
|
Hmm, the plot thickens. I restored my "broken" legends file, and tried searching for another HF who learned a secret from an artifact (and has teacher_hfid set to -1). For some reason, this worked fine. Could it be that the HFLearnSecret object itself somehow fails to be created? Full stack trace for good measure:
The (working) histfig's event:
EDIT: upon closer inspection, the code that does the artifact parsing might be failing here. I got this when trying to view the tower I found the book at:
EDIT 2: I found the root cause. Artifact ID 54 refers to a book that doesn't exist in the legends XML, so it's probably a bug in DF, not in Legends Viewer.
Still, it's probably worth replacing the artifact name by something like |
I'll update my local copy of the source and see about reproducing this weekend. Can you pass your export file? (Dropbox link/etc) |
Here's a google drive link: (file generated on DF 0.40.23, by the way) |
That'd do it. |
https://github.com/Parker147/Legends-Viewer/blob/master/LegendsViewer/Legends/Events.cs#L1252
It appears to check for teacher being null, but not the artifact. |
This was the event that caused the problem:
The HF in question is my adventurer, who learned the secrets of life and death by reading a tome. Hence, there's no teacher involved as such. I got a NullReferenceException on the LegendsViewer.Legends.HFLearnsSecret.Print call when I tried to view my adventurer's summary page in LegendsViewer.
Changing the teacher_hfid to match the student's fixed the issue, though, but there's probably some code assuming that a teacher id is always set to some sensible value.
I don't have a working C# build environment at hand right now, but I'll try and track down the piece of code responsible for the crash.
The text was updated successfully, but these errors were encountered: