From 7bf7d1e19965199d077538304252e2283144a5e8 Mon Sep 17 00:00:00 2001 From: codereader Date: Thu, 28 Dec 2017 07:53:44 +0100 Subject: [PATCH] Resolve #4710: Changing entity class from the spawnargs reverts it to Default Layer --- libs/entitylib.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libs/entitylib.h b/libs/entitylib.h index cee9ef5aeb..07da28b435 100644 --- a/libs/entitylib.h +++ b/libs/entitylib.h @@ -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);