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 #365 #378

Merged
merged 1 commit into from
Jan 6, 2014
Merged

Fix #365 #378

merged 1 commit into from
Jan 6, 2014

Conversation

Hoikas
Copy link
Member

@Hoikas Hoikas commented Jan 6, 2014

plRegistryKeyList::Read assumed that plUoid object IDs are always sequential. This is not the case since f664e8b resulted in all keys getting an ID. The problem manifested itself here because there were temporary materials that were being created and thrown away, causing object ID gaps.

This may also address #366, however this is untested.

@@ -203,14 +203,19 @@ void plRegistryKeyList::Read(hsStream* s)
s->ReadByte();

uint32_t numKeys = s->ReadLE32();
fKeys.reserve(numKeys);
fKeys.reserve(static_cast<size_t>(numKeys * 1.5f));
Copy link
Member

Choose a reason for hiding this comment

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

numkeys * 3 / 2 might be saner... I'm not sure I like going through a float :/

plRegistryKeyList::Read assumed that plUoid object IDs are always
sequential. This is not the case since f664e8b resulted in all keys
getting an ID. The problem manifested itself here because there were
temporary materials that were being created and thrown away, causing
object ID gaps.
branan pushed a commit that referenced this pull request Jan 6, 2014
@branan branan merged commit ec96fbe into H-uru:master Jan 6, 2014
@Hoikas Hoikas deleted the invisible-mats branch January 6, 2014 04:27
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.

None yet

2 participants