Skip to content
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

Fix form key persistence #101

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kieranknowles1
Copy link

weaponRecordsToPatch could contain duplicate weapons if multiple constructible objects produce the same weapon.

MakeEnchantedWeapon did not provide an editor ID at construction so would not use persistence.

This fixes #96

@@ -440,6 +441,8 @@ FormList GetFormList(string name)
})
.Where(x => x != null)
.Select(x => x!)
.GroupBy(x => x.AsLink())
Copy link
Member

@Noggog Noggog Apr 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey! Thanks for the PR!

I think this logic can be simplified to just be:
.Distinct(x => x.FormKey)

And while we're in the area, the

.Where(x => x != null)
.Select(x => x!)

can be simplified to
.NotNull()

Feel free to make the changes yourself, otherwise I'll merge this in the next few days and do the additional tweaks then. Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Misusing Persistence Systems
2 participants