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

WMO groups aren't fully cloned #151

Open
fallenoak opened this issue Jun 8, 2016 · 0 comments
Open

WMO groups aren't fully cloned #151

fallenoak opened this issue Jun 8, 2016 · 0 comments
Labels

Comments

@fallenoak
Copy link
Member

fallenoak commented Jun 8, 2016

WMOGroup holds a reference to the root WMO for the group. Unfortunately, we're not passing in the right root WMO reference when calling WMOGroup.clone(), which can have some unpleasant side effects if state for a given WMO doesn't match across its clones.

I just ran in to this issue when working on portal culling. Portals are stored on the root WMO, and include things like world position data. Maps that render multiple copies of the same WMO will have different world placement, which impacts the world position data for portals.

The fix should be as simple as...

Modifying WMOGroup.clone():

clone(wmo) {
  return new this.constructor(wmo, this.groupID, this.data, this.path);
}

Modifying the end of WMOGroupBlueprint.load():

return this.cache.get(path).then((wmoGroup) => {
  return wmoGroup.clone(wmo);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant