WolvenKit / CyberCAT

CyberPunk 2077 Customization Assistant Tool. Work in progress Savegame editor.
MIT License
158 stars 34 forks source link

Adding/Removing an entry in an AppearanceSection causes data destruction #41

Closed Deweh closed 3 years ago

Deweh commented 3 years ago

Steps to Reproduce: 1.) Create a character in-game with the default eyes (Eyes 01) and save 2.) Open save in CyberCAT.Forms & add a new entry to First Section -> TPP -> Additional List 3.) Set First String to "eyes" and Second String to "h071" (Eyes 08 for Female Character) 4.) Save

The resulting save is loadable in-game and the appearance is changed, but other nodes (such as stats) suffer data destruction. Attempting to re-open the save in CyberCAT causes a NullReferenceException at NodeEntry.SetNextNode

Deweh commented 3 years ago

54b9ffb342b374b7be1fc22a63586dff241683e0 fixes this issue, but 93bdbc868fb2bbef7d170a6e2cf5c0dabdafa8df & a44da05f34df1240e5bd9feeddfb05f02ec91887 re-introduce the issue in a greater capacity, causing data to be lost even if no node data has been changed.

envy commented 3 years ago

Could you please test if this works now? I reworked the whole offset/size calculations and added a test that showed that it should work now.

Deweh commented 3 years ago

Successful Tests:

Unsuccessful Tests:

The original issue seems to be resolved. Thank you for the comprehensive fix.