-
Notifications
You must be signed in to change notification settings - Fork 328
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
Add setter for StaticNPC.Data #2547
Add setter for StaticNPC.Data #2547
Conversation
Allows modders to edit static NPC data.
Can you explain the shortcomings of using the existing If only a few specific fields needs to be overwritten, we could add more public methods for those fields only. I'm concerned we're relaxing invariants and letting people create code that breaks in subtle ways. In spite of all this, I'm not a fan of the property setter on the struct. As far as I remember, you can't just do |
Allows changing of namebank and leaving hash unaltered.
You are correct. I added another SetLayoutData that only alters what I wanted access to. The issue was that the name bank was inaccessible. Also, it was not possible to alter other npc layout data without altering the hash unless the original location data is fetched from the RDB record. I added a method that allows mutating data without touching the hash. |
The
|
Move code that changes NPC name bank to a setter to avoid changing runtime data along with layout data.
Okay, I moved the code that sets the name bank to its own setter. I want to keep a version of SetLayoutData that doesn't rely on block x,y,z values to pass in a hash though. This allows the existing npcData to be altered without retrieving its previous x, y, and z values from the block record. |
Allows modders to edit static NPC data.