raziel23x / skyrim-plugin-decoding-project

Automatically exported from code.google.com/p/skyrim-plugin-decoding-project
1 stars 3 forks source link

Overwriting quest fragments or Quest Aliases may produce exceptions. #105

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Load skyrim.esm 
2.copy as ovveride quest 0006E803 in a new esp, save quit and reload.
3.scroll down to the quest name and rename it in the copy.
3.scroll up to the quest fragments.
4.drag and drop Skyrim fragments over the copy.

What is the expected output?
No change

What do you see instead?
An exception

What version of the product are you using? On what operating system?
3.0.28

Please provide any additional information below.
Exception is known to arise from miscalculating array or union size.
Same manipulation with Quest C02 does not produce the error, so my primary 
suspect is the aliases array.

Original issue reported on code.google.com by HuguesLe...@gmail.com on 8 Feb 2013 at 10:38

GoogleCodeExporter commented 9 years ago

Original comment by HuguesLe...@gmail.com on 8 Feb 2013 at 10:42

GoogleCodeExporter commented 9 years ago
So the core of the issue is that, when you add an element to a container, 
typically an array, there is a change notification that propagates upward. When 
that notification reaches high enough, this generates a BuildRef. And Builref 
scans all descendants, initializing them if required.
Our particular problem was that the memory buffer for the aliases was 
incomplete and either they got initialized with wrong value or the buildref 
scan "loast itself".
I can solve the issue by:
  1) raw copying the source element over the empty buffer as they are both of the same size.
  2) force a NotifyChanged before adding the elements to the destination array.

What I don't know at the moment is if it is a solution or a workaround.

I will have some lunch now, then I will upload the change later.

Original comment by HuguesLe...@gmail.com on 9 Feb 2013 at 1:10

GoogleCodeExporter commented 9 years ago
Corrected as of r1181

Original comment by HuguesLe...@gmail.com on 9 Feb 2013 at 6:48