Skip to content

Commit

Permalink
Resolve #4710: Changing entity class from the spawnargs reverts it to…
Browse files Browse the repository at this point in the history
… Default Layer
  • Loading branch information
codereader committed Dec 28, 2017
1 parent 39d50c0 commit 7bf7d1e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libs/entitylib.h
Expand Up @@ -462,6 +462,9 @@ inline scene::INodePtr changeEntityClassname(const scene::INodePtr& node,
// Traverse the child and reparent all primitives to the new entity node
scene::parentPrimitives(oldNode, newNode);

// Let the new node keep its layer information (#4710)
newNode->assignToLayers(oldNode->getLayers());

// Insert the new entity to the parent
parent->addChildNode(newNode);

Expand Down

0 comments on commit 7bf7d1e

Please sign in to comment.