-
Notifications
You must be signed in to change notification settings - Fork 930
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
Moved References #557
Moved References #557
Conversation
Conflicts: apps/opencs/model/world/columns.hpp apps/opencs/model/world/commands.cpp apps/opencs/model/world/commands.hpp apps/opencs/model/world/ref.cpp apps/opencs/view/world/dialoguesubview.cpp apps/opencs/view/world/dialoguesubview.hpp apps/opencs/view/world/util.cpp components/esm/cellref.hpp
Just noticed that I introduced a bug in cellref.cpp. |
Hmmm.... I think this isn't quite working. I don't see a MVRF record in Morrowind.omwgame.
EDIT2: The same thing happens with Tribunal. A "Base" ref becomes "Modified" when moved, but shows up as "Added" when omwgame is loaded. Need to investigate more. |
|
Closing till I make some more progress |
Loading seems ok, though. Here is an example of NoM 3.0.esm where a rock was moved between cells. And in 3D (the store wasn't rendering before, see forum posts https://forum.openmw.org/viewtopic.php?f=7&t=2606): |
…ref may still be referred by a mod.
Sorry, should have been more specific about that. Loading a move that was made with vanilla TES-CS was always working AFAIK. Seems a lot of things have changed while I was away. Will have a look. |
Yes but the loaded references were placed with the wrong cell (see the changes in data.cpp) |
Found a problem. Steps to reproduce:
Console output: std::bad_alloc |
Should be fixed. |
Better. No more crash. But instead of moving the Silt Strider, it is copied now (the original is still in place after a reload in OpenMW-CS). |
There are two problems. First, Data::mRefLoadCache was getting cleared when content file changes. So the ref loaded by content file 0 (Morrowind.esm) was missed by the moved ref loaded by content file 1 (Tribunal.omwgame). Second, the map search in RefCollection::load() uses mRefNum as the key to find the ref. But because the content file number is different, a cached entry is missed and a new ref is loaded (and now we have two, the original as well as the moved one). I hacked the files to get things working, but rather ugly. Also, I'm not 100% sure if the moved ref should have the content file number 1 (probably). EDIT: our content file numbering appears to be different to vanilla. Vanilla refs sometimes have content file number '-2'. Not sure what this means. It doesn't seem to be a relative position, since it occurs for Redesigned Vivec.esp where only Morrowind.esm (content file number 0) is loaded before the mod.
|
Okay. That seems to work. I think this is ready to be merged into master and also ready for the 0.36.0 release. I want more testing anyway and releasing it now seems like the right way to get that. Agreed? |
Yes, agreed. |
Okay. Will merge. Thanks. |
return false; | ||
if (esm.isNextSub("MVRF")) | ||
{ | ||
if (ignoreMoves) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this naming backwards? ignoreMoves would suggest when the parameter is true, the MVRF record is skipped, but the code does the opposite.
Feature #2262.